Keep select value in dropdown list without view state

Blessybaby
Posted by Blessybaby under ASP.NET category on | Views : 4810
protected void Page_Load(object sender, EventArgs e)
{
this.Dropdown1.DataSource = <give data sorce name>;
this.Dropdown1.DataTextField = <fieldname>;
this.Dropdown1.DataValueField =<fieldname>;
this.Dropdown1.DataBind();

string r = Request[Dropdown1.UniqueID];

if (r != null)
{
Dropdown1.SelectedValue = r;
}
}

Comments or Responses

Login to post response