Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.

Discussion in 'ASP .Net' started by Brano, Nov 7, 2005.

  1. Brano

    Brano Guest

    HI all,

    I have a problem i have a web application that was working fine and
    this morning when i run it and click on a button that does
    Reponse.Redirect to a page i get this error :

    Server Error in '/IPFWEb_6' Application.
    --------------------------------------------------------------------------------

    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.WebControls.ListItemCollection.SaveViewState()
    System.Web.UI.WebControls.ListControl.SaveViewState()
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    calcViewState)
    System.Web.UI.Page.ProcessRequestMain()


    I have tried to step thru the code but there is nothing wrong with it.
    I have even tried to use older version of this application that was
    definetly working and i still get the same error. I have reviewed some
    posts and one of them said it is cased by the TRACE if it is on but my
    trace is OFF. Does anyone have an idea what is this?

    Please help,

    Thanks BRANO
    Brano, Nov 7, 2005
    #1
    1. Advertising

  2. set your debugger to break on all exceptions. that should get the debugger
    to attach to the process on the line that caused the exception. You should
    be able to follow on from there.

    --
    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The Microsoft Office Web Components Black Book with .NET
    Now Available @ www.lulu.com/owc
    Forth-coming VSTO.NET - Wrox/Wiley 2006
    -------------------------------------------------------



    "Brano" <> wrote in message
    news:...
    > HI all,
    >
    > I have a problem i have a web application that was working fine and
    > this morning when i run it and click on a button that does
    > Reponse.Redirect to a page i get this error :
    >
    > Server Error in '/IPFWEb_6' Application.
    > --------------------------------------------------------------------------

    ------
    >
    > 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.WebControls.ListItemCollection.SaveViewState()
    > System.Web.UI.WebControls.ListControl.SaveViewState()
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
    > calcViewState)
    > System.Web.UI.Page.ProcessRequestMain()
    >
    >
    > I have tried to step thru the code but there is nothing wrong with it.
    > I have even tried to use older version of this application that was
    > definetly working and i still get the same error. I have reviewed some
    > posts and one of them said it is cased by the TRACE if it is on but my
    > trace is OFF. Does anyone have an idea what is this?
    >
    > Please help,
    >
    > Thanks BRANO
    >
    Alvin Bruney - ASP.NET MVP, Nov 7, 2005
    #2
    1. Advertising

  3. Brano

    Brano Guest

    Re: Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState()

    Hi Alvin,

    That sounds great but i dont know how to set the debuger to break at
    all exceptions can you help me? Thanks
    Brano, Nov 8, 2005
    #3
  4. Re: Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState()

    In Visual Studio, look in the Debug menu, at "Exceptions..."

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Complex things are made up of
    Lots of simple things.

    "Brano" <> wrote in message
    news:...
    > Hi Alvin,
    >
    > That sounds great but i dont know how to set the debuger to break at
    > all exceptions can you help me? Thanks
    >
    Kevin Spencer, Nov 8, 2005
    #4
    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.

Share This Page