Print Page | Close Window

Problem Please help.

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=15674
Printed Date: 29 March 2026 at 10:15am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Problem Please help.
Posted By: Leeb65
Subject: Problem Please help.
Date Posted: 30 June 2005 at 8:37am
I have a website in development, I changed a line of code in another form and got the following error in the login.
 

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

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

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.UI.Control.OnBubbleEvent(Object source, EventArgs args)
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   System.Web.UI.Page.ProcessRequestMain()
 
The code I changed is not related to this page and I have taken the code out again, but I still get this error.
 
Does anyone have the slightest idea what it could be.
 
I have done a debug trace and everything executes correctly then when it leaves my code the error comes.
 
Thanks
 
Lee


-------------
Lee

http://www.rheinsitemedia.de">



Replies:
Posted By: michael
Date Posted: 01 July 2005 at 6:00pm
It's a Null Reference Exception. Even though the code seems to be OK, you are querying something which does not exist aka is NULL. For example you have
Dim arr as array
For each s as string in arr
...
Next
Would cause a Null Reference Exception as arr does not have any members. If you put some clause to check for NULL around it, your code will surely run. (If I don't make sense, it's cause I am tired, hope you get the idea).


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Leeb65
Date Posted: 04 July 2005 at 2:52am
Michael,
 
Thanks for the reply, I honestly don't know what happened, but I restarted the computer and it all started to work again.
 
I had a problem the other week where the debugger said there was no source for the code I was running, reboot and it worked again.
 
thanks,
 


-------------
Lee

http://www.rheinsitemedia.de">



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net