Code For Redirection based on Dropdown list item

Jayakumars
Posted by Jayakumars under ASP.NET AJAX category on | Points: 40 | Views : 1508
<form id="form1" runat="server">
<asp:DropDownList ID="DrpList" runat ="server" >
<asp:ListItem Text ="Member" Value ="0">Member</asp:ListItem>
<asp:ListItem Text ="Director" Value ="1">Director</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Bt_Login" runat ="server" Text ="Submit"
onclick="Bt_Login_Click" />
</form>

protected void Bt_Login_Click(object sender, EventArgs e)
{
if (DrpList.SelectedValue == "0")
{
Response.Redirect("MemberMailing.aspx");
}
else
{
Response.Redirect("DirectorMailing.aspx");
}

}

Comments or Responses

Login to post response