Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
hello


I wants to validate radiobuttonlist in asp.net with C# on the click event of the button,if the user havnt selected the radiobuttonlist then it will pop up message to select the radiobuttonlist.

help me,please give the necessary code to validate radiobuttonlist .


thanks in advance
Posted

 
Share this answer
 
may this one will help you


http://forums.asp.net/t/1112298.aspx/1[^]
 
Share this answer
 
C#
if (rbl_Answer.SelectedIndex != -1)
           {
               string answer = rbl_Answer.SelectedItem.Text;
               string option = rbl_Answer.SelectedItem.Value;
           }
           else
           {
               lblError.Text="Select the Option";
           }

where rbl_Answer is the RadioButtonList in your ASP.Net page. If it is not selected show the error message in label or a Message box
 
Share this answer
 
 
Share this answer
 
 
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