473,320 Members | 2,189 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,320 software developers and data experts.

Object reference not set

I have a real stumper. I added a server side table to a home page that has
two other server side tables on it that have been working great. In Visual
Studio everything works great. When I put the page on the production server,
the first time in the page works great. If I navigate to any other page on
the site and then try to return to the home page the control I added throws
the following:

Server Error in '/' 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:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
MAFE.home.LoadBWOM()
MAFE.home.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +761

If I comment out the line of code where I store a row in the new table, all
works just fine. Anyone have any ideas?

--
Charlie Jursch
Patotech Software, Inc.
Danville, CA
Mar 10 '06 #1
8 1958
can you show us the line of code that you comment out to make it work, and
all relevant lines of code? Clearly something's null. It's easy to debug if
you step through it and add a breakpoint on that line...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Charlie J" <Ch******@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
I have a real stumper. I added a server side table to a home page that has
two other server side tables on it that have been working great. In
Visual
Studio everything works great. When I put the page on the production
server,
the first time in the page works great. If I navigate to any other page
on
the site and then try to return to the home page the control I added
throws
the following:

Server Error in '/' 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:

An unhandled exception was generated during the execution of the current
web
request. Information regarding the origin and location of the exception
can
be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
MAFE.home.LoadBWOM()
MAFE.home.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +761

If I comment out the line of code where I store a row in the new table,
all
works just fine. Anyone have any ideas?

--
Charlie Jursch
Patotech Software, Inc.
Danville, CA

Mar 10 '06 #2
Charlie, you may wish to read the reply I made to your original post - I
crossposted it to this group so it still has the original subject: "Re:
ASP.NET Problem with return to home page".
The conversation about this topic should, of course, continue in this
thread. I just wanted to draw your attention to what I said.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 10 '06 #3
Here is the line of code:

tdBWOM.InnerHtml = sb1.ToString();

In an attempt to isolate what is happening, I changed the html file to use a
html table instead of an asp:Table. I get the same result.

I cannot get this to fail on my test system, only on the production server.
When the page first displays, the text I put in the cell displays perfectly.
There is no error. Only when I navigate to another page on the site and then
navigate back to this page do I get the error. If you want to see the aspx
page after it is generated, go to www.mafe.org. It is the home page for the
site (default.aspx) that I am having the problem with. I currently have the
line of code above commented out in the code behind file.
--
Charlie Jursch
Patotech Software, Inc.
Danville, CA
"Karl Seguin [MVP]" wrote:
can you show us the line of code that you comment out to make it work, and
all relevant lines of code? Clearly something's null. It's easy to debug if
you step through it and add a breakpoint on that line...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Charlie J" <Ch******@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
I have a real stumper. I added a server side table to a home page that has
two other server side tables on it that have been working great. In
Visual
Studio everything works great. When I put the page on the production
server,
the first time in the page works great. If I navigate to any other page
on
the site and then try to return to the home page the control I added
throws
the following:

Server Error in '/' 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:

An unhandled exception was generated during the execution of the current
web
request. Information regarding the origin and location of the exception
can
be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
MAFE.home.LoadBWOM()
MAFE.home.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +761

If I comment out the line of code where I store a row in the new table,
all
works just fine. Anyone have any ideas?

--
Charlie Jursch
Patotech Software, Inc.
Danville, CA


Mar 10 '06 #4
Bob,

Thanks for your input. I have updated the web.config accordingly.
--
Charlie Jursch
Patotech Software, Inc.
Danville, CA
"Bob Barrows [MVP]" wrote:
Charlie, you may wish to read the reply I made to your original post - I
crossposted it to this group so it still has the original subject: "Re:
ASP.NET Problem with return to home page".
The conversation about this topic should, of course, continue in this
thread. I just wanted to draw your attention to what I said.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Mar 10 '06 #5
You still have not shown enough code to enable us to see what's happening.
All I can say is that you should determine which object it is complaining
about: tdBWOM or sb1. Insert some code to verify that both of these
variables are set to the appropriate objects.
You should do this before posting more code. :-)

Bob Barrows
Charlie J wrote:
Here is the line of code:

tdBWOM.InnerHtml = sb1.ToString();

In an attempt to isolate what is happening, I changed the html file
to use a html table instead of an asp:Table. I get the same result.

I cannot get this to fail on my test system, only on the production
server. When the page first displays, the text I put in the cell
displays perfectly. There is no error. Only when I navigate to
another page on the site and then navigate back to this page do I get
the error. If you want to see the aspx page after it is generated,
go to www.mafe.org. It is the home page for the site (default.aspx)
that I am having the problem with. I currently have the line of code
above commented out in the code behind file. --
Charlie Jursch
Patotech Software, Inc.
Danville, CA
"Karl Seguin [MVP]" wrote:
can you show us the line of code that you comment out to make it
work, and all relevant lines of code? Clearly something's null.
It's easy to debug if you step through it and add a breakpoint on
that line...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Charlie J" <Ch******@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
I have a real stumper. I added a server side table to a home page
that has two other server side tables on it that have been working
great. In Visual
Studio everything works great. When I put the page on the
production server,
the first time in the page works great. If I navigate to any other
page on
the site and then try to return to the home page the control I added
throws
the following:

Server Error in '/' 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:

An unhandled exception was generated during the execution of the
current web
request. Information regarding the origin and location of the
exception can
be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of
an object.]
MAFE.home.LoadBWOM()
MAFE.home.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +761

If I comment out the line of code where I store a row in the new
table, all
works just fine. Anyone have any ideas?

--
Charlie Jursch
Patotech Software, Inc.
Danville, CA


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 10 '06 #6
agreed.

If that's the line, it's clear that either sb is null or tdBWOM is null.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OU**************@TK2MSFTNGP14.phx.gbl...
You still have not shown enough code to enable us to see what's happening.
All I can say is that you should determine which object it is complaining
about: tdBWOM or sb1. Insert some code to verify that both of these
variables are set to the appropriate objects.
You should do this before posting more code. :-)

Bob Barrows
Charlie J wrote:
Here is the line of code:

tdBWOM.InnerHtml = sb1.ToString();

In an attempt to isolate what is happening, I changed the html file
to use a html table instead of an asp:Table. I get the same result.

I cannot get this to fail on my test system, only on the production
server. When the page first displays, the text I put in the cell
displays perfectly. There is no error. Only when I navigate to
another page on the site and then navigate back to this page do I get
the error. If you want to see the aspx page after it is generated,
go to www.mafe.org. It is the home page for the site (default.aspx)
that I am having the problem with. I currently have the line of code
above commented out in the code behind file. --
Charlie Jursch
Patotech Software, Inc.
Danville, CA
"Karl Seguin [MVP]" wrote:
can you show us the line of code that you comment out to make it
work, and all relevant lines of code? Clearly something's null.
It's easy to debug if you step through it and add a breakpoint on
that line...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Charlie J" <Ch******@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
I have a real stumper. I added a server side table to a home page
that has two other server side tables on it that have been working
great. In Visual
Studio everything works great. When I put the page on the
production server,
the first time in the page works great. If I navigate to any other
page on
the site and then try to return to the home page the control I added
throws
the following:

Server Error in '/' 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:

An unhandled exception was generated during the execution of the
current web
request. Information regarding the origin and location of the
exception can
be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of
an object.]
MAFE.home.LoadBWOM()
MAFE.home.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +761

If I comment out the line of code where I store a row in the new
table, all
works just fine. Anyone have any ideas?

--
Charlie Jursch
Patotech Software, Inc.
Danville, CA


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Mar 10 '06 #7
.... which leaves unanswered the question of why one of them is null, which
can best be answered by stepping through the code (not recommended in a
production environment, but a duplicate app could be created for testing, I
suppose). If stepping is not an option, then you have to manually backtrace
the lines of code leading up to this line and see if you can identify the
failure to instantiate the object.
Karl Seguin [MVP] wrote:
agreed.

If that's the line, it's clear that either sb is null or tdBWOM is
null.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OU**************@TK2MSFTNGP14.phx.gbl...
You still have not shown enough code to enable us to see what's
happening. All I can say is that you should determine which object
it is complaining about: tdBWOM or sb1. Insert some code to verify
that both of these variables are set to the appropriate objects.
You should do this before posting more code. :-)

Bob Barrows
Charlie J wrote:
Here is the line of code:

tdBWOM.InnerHtml = sb1.ToString();

In an attempt to isolate what is happening, I changed the html file
to use a html table instead of an asp:Table. I get the same result.

I cannot get this to fail on my test system, only on the production
server. When the page first displays, the text I put in the cell
displays perfectly. There is no error. Only when I navigate to
another page on the site and then navigate back to this page do I
get the error. If you want to see the aspx page after it is
generated, go to www.mafe.org. It is the home page for the site
(default.aspx) that I am having the problem with. I currently have
the line of code above commented out in the code behind file. --
Charlie Jursch
Patotech Software, Inc.
Danville, CA
"Karl Seguin [MVP]" wrote:

can you show us the line of code that you comment out to make it
work, and all relevant lines of code? Clearly something's null.
It's easy to debug if you step through it and add a breakpoint on
that line...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Charlie J" <Ch******@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
> I have a real stumper. I added a server side table to a home page
> that has two other server side tables on it that have been working
> great. In Visual
> Studio everything works great. When I put the page on the
> production server,
> the first time in the page works great. If I navigate to any
> other page on
> the site and then try to return to the home page the control I
> added throws
> the following:
>
> Server Error in '/' 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:
>
> An unhandled exception was generated during the execution of the
> current web
> request. Information regarding the origin and location of the
> exception can
> be identified using the exception stack trace below.
>
> Stack Trace:
>
>
> [NullReferenceException: Object reference not set to an instance
> of an object.]
> MAFE.home.LoadBWOM()
> MAFE.home.Page_Load(Object sender, EventArgs e)
> System.Web.UI.Control.OnLoad(EventArgs e) +67
> System.Web.UI.Control.LoadRecursive() +35
> System.Web.UI.Page.ProcessRequestMain() +761
>
> If I comment out the line of code where I store a row in the new
> table, all
> works just fine. Anyone have any ideas?
>
> --
> Charlie Jursch
> Patotech Software, Inc.
> Danville, CA


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 10 '06 #8
I resolved this issue by upgrading the application to APS.NET 2.0. This all
started to happen right after I had installed 2.0 on the servers. I cannot
explain why it was happening, only that after I converted the application to
2.0 everything started to work normally.

Thanks for your assistance.
--
Charlie Jursch
Patotech Software, Inc.
Danville, CA
"Charlie J" wrote:
I have a real stumper. I added a server side table to a home page that has
two other server side tables on it that have been working great. In Visual
Studio everything works great. When I put the page on the production server,
the first time in the page works great. If I navigate to any other page on
the site and then try to return to the home page the control I added throws
the following:

Server Error in '/' 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:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
MAFE.home.LoadBWOM()
MAFE.home.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +761

If I comment out the line of code where I store a row in the new table, all
works just fine. Anyone have any ideas?

--
Charlie Jursch
Patotech Software, Inc.
Danville, CA

Mar 13 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chris S. | last post by:
I'm trying to make a graphical editor and browser for Pickled files. One aspect I'm not sure about is how to detect multiple references to the same data. For instance, say I had the Pickled...
28
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()',...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
29
by: web1110 | last post by:
If I have 2 variables, A and B, referencing the same object and then do a A.Dispose(), what happens to B?
5
by: Michael Moreno | last post by:
Hello, In a class I have this code: public object Obj; If Obj is a COM object I would like to call in the Dispose() method the following code: ...
16
by: anonymous.user0 | last post by:
The way I understand it, if I have an object Listener that has registered as a listener for some event Event that's produced by an object Emitter, as long as Emitter is still allocated Listener...
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
3
by: User1014 | last post by:
A global variable is really just a property of the "Global Object", so what does that make a function defined in the global context? A method of the Global Object? ...
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);
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.