how to redirect a page when drop down index is changed in asp.net using c#

in this web programming tutorial you will learn that how to redirect a page when a drop down selected index is changed or in other meanings on change event in asp.net using c#.
just copy and paste the below code in your page as mention below

Code for your .aspx file

  
  asp:ListItem Selected="True">All
                    Google
                    yahoo
                    MSN
                

code for .aspx.cs file.
  protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
     response.redirect("testpage.aspx");
    }

Admin

A Software Engineer, Social Media Marketing Expert, writer,

Post a Comment

Previous Post Next Post