tia_kamakshi
asked on
Capture dropdownlist value changed
Hi Experts,
I am working on ASP.NET 2.0 using C#
I wanted to update label whenever my value is dropdown list changed.
I have written code which is not working.
Please guide me with the issue
Thanks
ASPX CODE
CODE BEHIND
I am working on ASP.NET 2.0 using C#
I wanted to update label whenever my value is dropdown list changed.
I have written code which is not working.
Please guide me with the issue
Thanks
ASPX CODE
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>A</asp:ListItem>
<asp:ListItem>B</asp:ListItem>
<asp:ListItem>C</asp:ListItem>
<asp:ListItem>D</asp:ListItem>
<asp:ListItem>E</asp:ListItem>
</asp:DropDownList>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
CODE BEHIND
protected void Page_Load(object sender, EventArgs e)
{
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
string str = DropDownList1.SelectedValue;
Label1.Text = str;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER