0

I have a asp radio button list which has 3 options:

Option 1 Option 2 Option 3

Think of this as a question as such and "Option 2" is the correct option to select which will take you to a success page.

What is the code to be able to do this?

Here is what I currently have:

enter image description here

If a user chooses "Option 1" I need to be able to show a custom validation message saying something like "Nearly but not quite - please try again"

All suggestions are welcome!

1 Answer 1

2

try:

<asp:ListItem Value="0" Text="Option 1"></asp:ListItem>
<asp:ListItem Value="1" Text="Option 2"></asp:ListItem>

in your SelectedIndexChanged

if (YourRedioButtionID.SelectedValue.ToString() == "0")
            {
               Responce.Redirest("successpage.aspx");
            }
            else
            {
                //your message in level.
            }
Sign up to request clarification or add additional context in comments.

1 Comment

Perfect Shree Khanal! Thanks heaps for all your help :-D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.