Click here to Skip to main content
16,016,425 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a RadioButtonList and a CreateUzerWizard.
When user click on the createte-user Button of Create-User wizard,
first It has to varify whether user has selected any radio-button
if no stop the create-user action
protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
    {        
        if (RadioButtonList1.SelectedIndex == -1)
        { return;//not to proceed             
        }
    }

But still though user not select the radiobutton create-user action is taking place. How can I prevent the create-user action at this point.
Thanks for help in advance
Posted
Updated 18-Feb-11 19:27pm
v2

1 solution

Add a line:
C#
protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
    {
        if (RadioButtonList1.SelectedIndex == -1)
        { 
            e.Cancel=true;  // <----- Add this line.
            return;//not to proceed
        }
    }
See MSDN[^] for details.
 
Share this answer
 
Comments
SHAJANCHERIAN 20-Feb-11 7:56am    
Thanks

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