Member
401 Points
402 Posts
Apr 30, 2010 08:19 AM|ashiqf|LINK
Refer to the below code:
<body>
Select Name:
<asp:ListItem>Please Select</asp:ListItem>
<asp:ListItem>Ashiq</asp:ListItem>
<asp:ListItem>Samsul</asp:ListItem>
</asp:DropDownList><br />
<br />
<asp:Label ID="Label1" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel></div>
</form></body>
Code Behind:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "Ashiq")
Label1.Text = "You have selected Ashiq";
}
if (DropDownList1.SelectedValue == "Samsul")
Label1.Text = "You have selected Samsul";
Please mark as answer if it worked..
Member
401 Points
402 Posts
Re: Playing with update Panels.
Apr 30, 2010 08:19 AM|ashiqf|LINK
Refer to the below code:
<body>
Select Name:
<asp:ListItem>Please Select</asp:ListItem>
<asp:ListItem>Ashiq</asp:ListItem>
<asp:ListItem>Samsul</asp:ListItem>
</asp:DropDownList><br />
<br />
<asp:Label ID="Label1" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel></div>
</form></body>
Code Behind:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "Ashiq")
{
Label1.Text = "You have selected Ashiq";
}
if (DropDownList1.SelectedValue == "Samsul")
{
Label1.Text = "You have selected Samsul";
}
}
Please mark as answer if it worked..
Ashiq