We help IT Professionals succeed at work.
Get Started

getting selected value when there is no selected value in asp.net

d2fox asked
Last Modified: 2012-05-09
So i have the code in my page below which is displayed for the first time to collect data from the user, when I  don't selected anything, submit the screen and then execute the statement:

If Insurance.SelectedValue Is Nothing Then

it fails this check.  It also stores a 'false' in my database, when I
Insurance.SelectedValue, tied to a bit field in my database.

How can I find out if there was nothing selected by the user.
<asp:RadioButtonList ID="Insurance" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="True">Yes</asp:ListItem>
                        <asp:ListItem Value="False">No</asp:ListItem>

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 16 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE