|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Object reference not set to an instance of an object
Dear all
I am totally new to ASP.NET and I am trying to follow some examples from a book I have bought. However i have encountered the following error:- Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 56: strPanelName = "pnlForm" & ViewState("CurrentPage") Line 57: pnlPanel = FindControl(strPanelName) Line 58: pnlPanel.Visible = True Line 59: Line 60: End Sub Source File: C:\Inetpub\wwwroot\JohHidingContent\PanelMultiPage .aspx.vb Line: 58 Here is my code for this section:- Sub btnNextPage_Click(ByVal s As Object, ByVal e As EventArgs) Dim pnlPanel As Panel Dim strPanelName As String 'Hide Previous Panel strPanelName = "pnlForm" & ViewState("CurrentPage") pnlPanel = FindControl(strPanelName) pnlPanel.Visible = False 'Show current Panel ViewState("CurrentPage") += 1 strPanelName = "pnlForm" & ViewState("CurrentPage") pnlPanel = FindControl(strPanelName) pnlPanel.Visible = True End Sub Can you please help me out? Thanks |
|
#2
|
|||
|
|||
|
OK I found the error, I forgo to declare it in the HTML
Thanks |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > Object reference not set to an instance of an object |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|