"Object reference not set to an instance of an object." error at postback

L

louie.hutzel

This JUST started happening, I don't remember changing any code:
When I click the submit button on my form, stuff is supposed to happen
(which it does correctly) and a result message is posted back to the
same page at the top of my form alerting the user that their request
has been approved or denied. However, the end result is an error
message:

Error Message:
Object reference not set to an instance of an object.

Error Stack:
System.NullReferenceException: Object reference not set to an instance
of an object.
at System.Web.UI.Control.OnBubbleEvent(Object source, EventArgs
args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData)
at System.Web.UI.Page.ProcessRequestMain()


As you can see, there no reference to any line of code, when I step
thru it, everything gets executed as it should. Data that is to be
saved to the database is saved. The error message appears immediately
after the last 'end sub', and all code is executed. It only seems
to happen when a page is supposed to post back to itself.

I started erasing code for the button, all of it, until all the code
that was left for the button was "end sub," and it still drew the
same error. However, when I put a Response.Redirect() statement in the
code, it redirects to the new page properly. Also there is no Page_Load
code for the page (it starts as an empty form).

Under a "locals" observation while running the program, I noticed
that under the 'me' watch, the "binding container" value =
<error: an exception of type: {System.NullReferenceException}
occurred>. I don't know what this means, or if that's the problem.
 
J

jeffmagill

Louie,

My guess would be that your problem is located with your binding
container that you mentioned towards the end of your post.

Could you post your code the parts of your code that are relevant?

Jeff
 
L

Louie

I don't know what to say.

I came into work today, ran my program and it had no errors. I'm
thinking the problem must have been a server issue on my workstation
and it resolved it self with a system reboot. I'll post my code if I
get the error again, but I'm not sure how it would help; Yesterday, I
troubleshot the problem down to only white space between the sub and
end-sub statements, and it still drew an error.

But all seems to be running smooth this morning... so far.

Thanks
Louie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top