Thursday 1 March 2012

How to pass field value from one page to another page

Case: we need to send dropdownlist value which is in home page to search result page on button click


in button click include this
 
     Response.Redirect("Searchresults.aspx?DropDownList1=" + DropDownList1.SelectedItem.Text);

in serach result page access the value like this 

      String s = Request.QueryString["DropDownList1"];
       Label4.Text = s;


Thats it..........



DropDownList1 is the variable wch holds the value
DropDownList1.SelectedItem.Text is the property for the value.

No comments:

Post a Comment