I am tring to setup a multipage form look. I am getting the following error.
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:
Line 40: strPanelName = "pnlForm" & ViewState( "CurrentPage"
Line 41: pnlPanel = FindControl( strPanelName )
Line 42: pnlPanel.Visible = false
Line 43: 'Show Current Panel
Line 44: ViewState( "CurrentPage" ) += 1
Here is the sub.
Sub btnSection1_click( s As Object, 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
Any help would be great!
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:
Line 40: strPanelName = "pnlForm" & ViewState( "CurrentPage"
Line 41: pnlPanel = FindControl( strPanelName )
Line 42: pnlPanel.Visible = false
Line 43: 'Show Current Panel
Line 44: ViewState( "CurrentPage" ) += 1
Here is the sub.
Sub btnSection1_click( s As Object, 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
Any help would be great!