Passing Value from one page to another page
There is three more way to transfer value (rather then request.querystring or response.redirect) from one page to another…Check it out…
Default.aspx
These Code Written on Button Click
string str = txt.Text;
1) // By Context we could pass the value to one page to another
Context.Items.Add(“name”,str);
Server.Transfer(“JQueryPage.aspx”);
2) //By Session
Session["name"] = str;
3) //This is a new feature in asp.net2.0, In this term I went to the property of button and
set the postbackurl= “~/JQueryPage.aspx”
Then after I went to the JqueryPage and find the textbox control “txt” which I created in my root page so based on it I got my value directly
In the JqueryPage
We can Transfer Data From One Page to Another Page
JQueryPage.aspx
This code written on Page Load
1) // By Context
string sessionval = Context.Items["name"].ToString();
txt.Text = sessionval;
2) // This is By Session
string sessionval= Session["name"].ToString();
txt.Text = sessionval;
3) // By Previous PAge
TextBox txt1 = (TextBox)PreviousPage.FindControl(“txt”);
txt.Text = txt1.Text;
November 19, 2008 at 10:32 am
A nice article…
December 30, 2008 at 8:31 am
Quite useful!!