TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
waterfall
NA
5
0
Help! Object reference...
Apr 16 2005 4:45 AM
Hi! Can someone help me please, I get this error when I run application: Object reference not set to an instance of an object. 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 52: public bool haveInited Line 53: { Line 54: get { return (bool)Session.Contents["haveInited"]; } Line 55: set { Session.Contents[ "haveInited" ] = value; } Line 56: } Source File: c:\inetpub\wwwroot\oxcet3\oxform.aspx.cs Line: 54 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] ox4.Ox4Form.get_haveInited() in c:\inetpub\wwwroot\oxcet3\oxform.aspx.cs:54 ox4.Ox4Form.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\oxcet3\oxform.aspx.cs:66 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain() Application is C# generated from Prolog, using P# (Jon Cook is author of P#). Here is the link http://www.dcs.ed.ac.uk/home/jjc/psharp/psharp-1.1/dlpsharp.html It is P# example of game Noughts and Crosses. Problematic code is: public bool haveInited { get { return (bool)Session.Contents["haveInited"]; } set { Session.Contents[ "haveInited" ] = value; } } protected System.Web.UI.WebControls.Button[] Cells; private void Page_Load(object sender, System.EventArgs e) { Cells = new Button[] { Cell1, Cell2, Cell3, Cell4, Cell5, Cell6, Cell7, Cell8, Cell9, Cell10, Cell11, Cell12, Cell13, Cell14, Cell15, Cell16 }; if( !haveInited ) { haveInited = true; ResetBoard(); } } It fails on if(!haveInited) line...
Reply
Answers (
6
)
Need urgent help to create directory and upload file
Web controls are not displaying