• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1282
  • Last Modified:

ASP NET How to read stack trace to fix error

I am getting the following error. How do I use the stack trace to determine what to do next?

System.ArgumentNullException: Value cannot be null. Parameter name : child

SOURCE ERROR

else
me.pn1dsl = Session("pnDSL")
phMain.Controls.Add(Me.pn1DSL) <--- error
end if

STACK TRACE

[ArgumentNull Exception: Value cannot be null.
Parameter name: child]

System.Web.UI.ControlCollection.Add(Control child) +197
SeatUpdate.SeatUpdateDSL.Page_Load(Object sender, Event Args e) in c:\intetpub\wwwroot\SeatUpdate\SeatUpdateDSL.aspx.vb: 48

System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
0
marcon33
Asked:
marcon33
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
It suggests that the Session variable "pnDSL" is null. You could change your code to something like:

    Else
        If Not Session("pnDSL") Is Nothing Then
            Me.pn1dsl = Session("pnDSL")
            phMain.Controls.Add(pnDSL)
        End If
    End If

The stack trace really won't provide anymore useful information.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now