Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old February 1st, 2006, 11:15 AM
Authorized User
Join Date: Feb 2006
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Class Object reference error.

I'm trying to write debugging information to the Trace stack as my code executes. However, I recieve "Object reference not set to an instance of an object." with the code
Line 55:         '----------------------------------------------------
Line 56:         Dim TraceWrite As UserControl
Line 57:         TraceWrite.Trace.Write("Begin GetUserID")
Line 58: 
Line 59:         If HttpContext.Current.Session("UserID") Is Nothing Then

Source File: C:\Inetpub\wwwroot\Modules\Modules\DB\DataLayer.vb    Line: 57 

Stack Trace: 

[NullReferenceException: Object reference not set to an instance of an object.]
   Modules.DataLayer.GetUserID() in C:\Inetpub\wwwroot\Modules\Modules\DB\DataLayer.vb:57
   Modules.LinkBar.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Modules\Controls\LinkBar.ascx.vb:30
   System.Web.UI.Control.OnLoad(EventArgs e)
Any help is appreciated.


  #2 (permalink)  
Old February 2nd, 2006, 05:45 AM
Authorized User
Join Date: May 2005
Location: pune, maharashtra, India.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Michael,

If u want to create NEW User COntrol everytime, you shud use "new" while
declaring user control as follows:

        Dim TraceWrite As New UserControl

Let me know if it works..

Muskaan. :)

  #3 (permalink)  
Old February 2nd, 2006, 09:28 AM
Authorized User
Join Date: Feb 2006
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts


thank you, however, the error is still there :(



Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using class reference getting error rojiin ASP.NET 2.0 Basics 2 July 6th, 2007 02:53 PM
Error: Object Reference not set to an instance. Nosfe_X VB Databases Basics 2 June 23rd, 2006 05:10 PM
Getting Error - "Object reference not set to an in peri C# 2 December 24th, 2004 11:20 AM
Object reference Error mrideout BOOK: Beginning ASP.NET 1.0 4 August 9th, 2004 08:29 AM
Object reference error shaileshmark SQL Server 2000 2 July 22nd, 2004 04:13 PM

All times are GMT -4. The time now is 12:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.