Solved

Unselected radio button list...

Posted on 2004-08-13
3
828 Views
Last Modified: 2008-02-01
When using the following if statement, it works fine if one of hte items is selected...

I'm crashing if none of the radio buttons are selected.

If (rblPart.SelectedItem.Text = "Make Part") Then

Ideas???

Thanks,
0
Comment
Question by:Weller0123
3 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 11796367
SelectedItem is a reference to the selected listitem, if there isn't a selected value, this is null, which is why you are getting the error.  You need to check to see if this is null or nothing first, then act accordingly
0
 
LVL 15

Accepted Solution

by:
Thogek earned 500 total points
ID: 11796368
Well, you're trying to access the SelectedItem, which would be a problem is no item is selected....

Perhaps

    If (rblPart.SelectedIndex <> -1) Then
        If (rblPart.SelectedItem.Text = "Make Part") Then
0
 
LVL 8

Expert Comment

by:daffodils
ID: 11796442
Thogek has the right bit of code for you..


0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Turn on intranet settings 1 57
Split in Javascript 5 39
Run time Error 4 47
IIS issues - Convert to Application - APS.NET v4.0 3 35
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question