By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,052 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

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

P: n/a
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(Command EventArgs e)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection
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.

Jun 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
lo**********@gmail.com wrote:
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(Command EventArgs e)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection
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.


Jun 20 '06 #2

P: n/a
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

Jun 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.