p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# 2005 (http://p2p.wrox.com/forumdisplay.php?f=138)
-   -   Radio button (http://p2p.wrox.com/showthread.php?t=66394)

gaurisharya March 5th, 2008 02:21 AM

Radio button
 
if(all.Checked)
        {
           query="Select * from applicant_info";
        }
        else if(follow_up.Checked)
        {
             query="Select * from applicant_info";
        }

hi,
i m using asp classic with code behind language as c#.
Here i hv used radio buttn.now i want to check which button i hv selected using if statement.Bt m gettin an error

 System.NullReferenceException: Object reference not set to an instance of an object.




samjudson March 5th, 2008 05:17 AM

ASP Classic? That is what most people call the pre-.Net version of ASP, written in VBScript. I suspect that's not what you are talking about.

If you are posting to the C#2005 forum then I hope you are using ASP.Net 2.0, otherwise you're on the wrong forum.

If you are getting a NullReferenceException then it means one of your variables is null. The exception should have given you a line number. Knowing this will most likely let you know which variable it is.

/- Sam Judson : Wrox Technical Editor -/

robzyc March 16th, 2008 06:43 AM

samjudson is right on the mark there!

The stack trace output by the exception should indicate the line that is failing..

Its important you get used the information provided by the Exception and debugging tools to overcome these issues, as well of course as identifying your development platform ;)

Rob
The Developing Developer
Currently Working Towards: MCAD C#
My Blog: http://www.robzyc.spaces.live.com
<center>"Nothing can stop the man with the right mental attitude from achieving his goal;
nothing on earth can help the man with the wrong mental attitude".

Thomas Jefferson</center>


All times are GMT -4. The time now is 09:00 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.