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

Discussion in 'ASP .Net' started by louie.hutzel@gmail.com, Jun 20, 2006.

  1. Guest

    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.
     
    , Jun 20, 2006
    #1
    1. Advertising

  2. Guest

    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


    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(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.
     
    , Jun 20, 2006
    #2
    1. Advertising

  3. Louie Guest

    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
     
    Louie, Jun 21, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Parthiv Joshi
    Replies:
    2
    Views:
    702
    Kalyan
    Jul 2, 2004
  2. Suresh Kojhani
    Replies:
    1
    Views:
    2,398
    Anushi
    Jul 29, 2004
  3. Lauchlan M
    Replies:
    1
    Views:
    2,372
    S. Justin Gengo
    Aug 18, 2003
  4. Tim Zych
    Replies:
    2
    Views:
    552
    Andy Gaskell
    May 15, 2004
  5. Replies:
    1
    Views:
    488
    Mark Rae [MVP]
    Sep 20, 2007
Loading...

Share This Page