473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Object reference not set to an instance of an object error

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
2 1290
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pkpatel | last post by:
Hi, I keep getting this error every time I try to load crystalreportviewer on a webform with a dataset. Here is the error: -------------------------------------------------------- Server...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
6
by: blash | last post by:
Can someone help me? I really don't have a clue. My company staff told me they often got such error: "Object reference not set to an instance of an object." when they are in search result page...
3
by: nemo | last post by:
Hi, My application works fine on the localhost but spits this error as soon as I put it on the server. I know this error occurs when an object has not been instantiated prior to a reference, but...
3
by: Adam | last post by:
We have a web site that uses .vb for the web pages and .cs for a class module. We are getting the error in .NET 2.0 and VS 2005 beta 2. It does work with .NET 1.1. When trying to access a page...
7
by: Brett | last post by:
I'm not sure why I keep getting this error, "Object reference not set to an instance of an object". Private Function somefunction() as string Dim MyCurrentClass As New Class1 Try For i As...
4
by: Luke Matuszewski | last post by:
Here are some questions that i am interested about and wanted to here an explanation/discussion: 1. (general) Is the objectness in JavaScript was supported from the very first version of it (in...
0
by: cnSoftware | last post by:
I come across this problem during my recent project and even now I am still be puzzled by it. So I paste the procedure here. I wish you can figure out where I am wrong or missing. The sample...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
2
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.