Wrox Programmer Forums
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2008, 02:21 AM
Registered User
 
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.



 
Old March 5th, 2008, 05:17 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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 -/
 
Old March 16th, 2008, 06:43 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

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>





Similar Threads
Thread Thread Starter Forum Replies Last Post
radio button anwarraja Javascript 3 September 18th, 2007 08:18 PM
Radio button Jolley_tolson Javascript 2 July 15th, 2007 05:50 AM
radio-button grstad HTML Code Clinic 3 February 28th, 2006 08:32 AM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM
radio button damnnono_86 Access 5 October 28th, 2003 02:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.