By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,559 Members | 1,150 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,559 IT Pros & Developers. It's quick & easy.

Object reference not set to an instance of an object error

P: n/a
A web form in my app is not running anymore. Whenever I try to do an action,
I get an error:

Server Error in '/codelib' Application.
----------------------------------------------------------------------------
----
Object reference not set to an instance of an object.
weird thing is that I just posted this app live yesterday and it works fine
on my web host. I try to run it from VS.Net and I can't.
Commenting out various code lines does not help. Even the simplest actions
return the same error.

Why would this occur and how can I fix it?

I'm using .net 1.0.

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ok, I think the error was because the dropdown list had nothing in it and
the code was trying to use a value from it.

I had assumed the Page_Load event was getting triggered (which is is not).

Interesting, the Page_Load event is working on my host, but not in VS.Net.

I am wondering if it has anything to do with the extra code that VS.Net
adds. I see a difference between the version I did w/o VS.Net and the VS.Net
version. VS.Net adds more code:

For example in VS.Net I see:
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load

but in the notepad version this suffices:

Sub Page_Load(Source As Object, E As EventArgs)

I suppose the framework does not require all of the additional code that
VS.Net adds?

At least it is working now.

"Tim Zych" <tzych@earth_noworms_link_dotttt.net> wrote in message
news:O#**************@tk2msftngp13.phx.gbl...
A web form in my app is not running anymore. Whenever I try to do an action, I get an error:

Server Error in '/codelib' Application.
-------------------------------------------------------------------------- -- ----
Object reference not set to an instance of an object.
weird thing is that I just posted this app live yesterday and it works fine on my web host. I try to run it from VS.Net and I can't.
Commenting out various code lines does not help. Even the simplest actions
return the same error.

Why would this occur and how can I fix it?

I'm using .net 1.0.



Nov 18 '05 #2

P: n/a
I'm not sure about VB.NET, but when editing ASP.NET files in C# VS.NET loves
to erase event handlers.

"Tim Zych" <tzych@earth_noworms_link_dotttt.net> wrote in message
news:u%****************@TK2MSFTNGP10.phx.gbl...
Ok, I think the error was because the dropdown list had nothing in it and
the code was trying to use a value from it.

I had assumed the Page_Load event was getting triggered (which is is not).

Interesting, the Page_Load event is working on my host, but not in VS.Net.

I am wondering if it has anything to do with the extra code that VS.Net
adds. I see a difference between the version I did w/o VS.Net and the VS.Net version. VS.Net adds more code:

For example in VS.Net I see:
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load

but in the notepad version this suffices:

Sub Page_Load(Source As Object, E As EventArgs)

I suppose the framework does not require all of the additional code that
VS.Net adds?

At least it is working now.

"Tim Zych" <tzych@earth_noworms_link_dotttt.net> wrote in message
news:O#**************@tk2msftngp13.phx.gbl...
A web form in my app is not running anymore. Whenever I try to do an

action,
I get an error:

Server Error in '/codelib' Application.


--------------------------------------------------------------------------
--
----
Object reference not set to an instance of an object.
weird thing is that I just posted this app live yesterday and it works

fine
on my web host. I try to run it from VS.Net and I can't.
Commenting out various code lines does not help. Even the simplest actions return the same error.

Why would this occur and how can I fix it?

I'm using .net 1.0.


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.