Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
    <asp:ListItem>Option1</asp:ListItem>
    <asp:ListItem>Option2</asp:ListItem>
    <asp:ListItem>Option3</asp:ListItem>
    <asp:ListItem>Option4</asp:ListItem>
    <asp:ListItem>Option5</asp:ListItem>
    <asp:ListItem>Option6</asp:ListItem>
</asp:RadioButtonList>

    <p></p>
    <p></p>
    <asp:Button ID="Button1" runat="server" Text="Go To URl" OnClick="Button1_Click" />



If the user clicks Option1 then i want to redirect him to www.URL1.com
if he click Option2 then i want to redirect him to www.someplace.com

What I have tried:

<asp:Button ID="Button1" runat="server" Text="Go To URl" OnClick="Button1_Click" />
Posted
Updated 18-Mar-16 7:09am

1 solution

This is something very easy that you should be able to do yourself. However, a simple example:

C#
if (RadioButtonList.SelectedItem.Text == "Option1")
{
  Response.Redirect("someurl");
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900