.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 10th, 2004, 03:23 PM
monfu monfu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Dublin
Posts: 40 monfu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 25 sec
Reputation Power: 6
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

Reply With Quote
  #2  
Old March 10th, 2004, 03:35 PM
monfu monfu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Dublin
Posts: 40 monfu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 25 sec
Reputation Power: 6
OK I found the error, I forgo to declare it in the HTML

Thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Object reference not set to an instance of an object


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT