Navigation help of Dropdown List

Sandeepraturi
Posted by Sandeepraturi under C# category on | Points: 40 | Views : 929
---------------put this code inside of body tag-------------

<body>
<form id="form1" runat="server">
<div>
<h1> Select Profile</h1><br />
<asp:DropDownList ID="dl" runat="server" onselectedindexchanged="dl_SelectedIndexChanged" AutoPostBack="true" >

<asp:ListItem>Slect Profile</asp:ListItem>
<asp:ListItem>Sandeep</asp:ListItem>
<asp:ListItem>Pradeep</asp:ListItem>
<asp:ListItem>Dinesh</asp:ListItem>

</asp:DropDownList>
</div>
</form>
</body>
--------------------put this inside of DropdownList SelectIndexChanged-----------------------


protected void dl_SelectedIndexChanged(object sender, EventArgs e)
{

if (dl.SelectedItem.Text == "Sandeep")
Response.Redirect("sandeep.aspx");

if (dl.SelectedItem.Text == "Pradeep")
Response.Redirect("pradeep.aspx");

if (dl.SelectedItem.Text == "Dinesh")
Response.Redirect("dinesh.aspx");

}

Comments or Responses

Login to post response