ASP.NET - how to change a button's text on changing dropdown list + asp.net

Asked By George n t on 20-Nov-12 12:35 AM
Hi friends,
I am using Vs 2005 ,asp.net,c#
how to change a button's text on changing dropdown list ?
Thanks in advance

George
MARKAND BHATT replied to George n t on 20-Nov-12 09:18 AM
Let us assume that name of button is btnValue
And dropdownlist's name is drpValue

protected void Page_Load(object sender, EventArgs e)
{
   drpValue.AutoPostBack = true;
   drpValue.SelectedIndexChanged+=new EventHandler(drpValue_SelectedIndexChanged);
}
  
protected void drpValue_SelectedIndexChanged(object sender, EventArgs e)
{
   btnValue.Text = "My new value";
}


Try the above code