开发者

passing parameter in asp.net c# [duplicate]

开发者 https://www.devze.com 2023-02-13 12:44 出处:网络
This question already has answers here开发者_Python百科: Closed 11 years ago. Possible Duplicate: Passing data between asp.net pages
This question already has answers here开发者_Python百科: Closed 11 years ago.

Possible Duplicate:

Passing data between asp.net pages

how to pass value of TEXTBOX from one page to another page in ASP.NET c# I need, not by using URL string query method. I do need passing from one page to another without passing values by URL.


Use the session state.

Session["TextBoxValue"] = TextBox1.Text;

Then, retrieve it on the other page:

string val = Session["TextBoxValue"];


you can create a form in the first page, this form contains your required parameters and use an action redirect to another page like in this example:

<form method="post" action="yoursecondpage.aspx">
  <input ... />
</form>

Another way is using a Server.Transfer("mySecondPage", true), in the second page, on Page_Load event you can cast "PreviousPage as MySecondPage" and get properties .

0

精彩评论

暂无评论...
验证码 换一张
取 消