incosistent error on windows 2003 server machines

J

Jimi200478

Hello All,

Okay....here goes.We are currently in the process of updating our
servers to windows 2003 server from Windows 2k. Before making any
changes to our production environment, we ran the new servers on our
test environments to make sure that we had everything configured
correctly. We had no problems in the test environments, and moved the
servers into production earlier this week. That is when the s**t hit
the fan.

we have been receiving an inconsistent, but frequent object reference
error coming from our page template. particularly, the method that
attaches our session id to the url (we have custom session management
using sqlserver because we use multiple servers that share session). In
this method, we loop through all of the controls on the page, and if we
find a hyperlink on the page, we append the session id to the end of
the url. my reason for stating all of this is that im not sure if the
problem is with our session management, or if its occuring in the
process of looping through the controls. due to the fact that it is
nearly impossible to predict when this error will occur (all we know is
that it occurs alot), and the message and stacktrace provide little to
no help, we dont really know which direction to take in trying to fix
the problem. additionally, this was not occuring on the test
environments (we're thinking because the load was much less than
production).

what could be causing this problem?? here is the error message:

************************************************************************

object reference not set to an instance of an object.

stack trace:

[NullReferenceException: Object reference not set to an instance of an
object.]
Components.Controls.PageTemplate.BaseTemplate.AdSessionIdToHyperLinks(ControlCollection
ActiveControl) + 239
Components.Controls.PageTemplate.BaseTemplate.AdSessionIdToHyperLinks(ControlCollection
ActiveControl) + 307
Components.Controls.PageTemplate.BaseTemplate.ApplyPageCustomizations()
+22
Components.Controls.PageTemplate.BaseTemplate.Page_Load(object sender,
EventArgs e) + 35
System.EventHandler.Invoke(object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e)+67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

************************************************************************

At this point, any input or suggestions would be greatly appreciated.
if we can at least determine wher the problem lays, researching
solutions will be much easier.

Thanks!

Jimi
 
J

Jimi200478

here is the method that its blowing up on:

public void AddSessionIdToHyperLinks(System.Web.UI.ControlCollection
ActiveControls)
{
HyperLink Link;
Control TempControl;

for(int x=0;x<ActiveControls.Count;x++)
{
TempControl = ActiveControls[x];
Link = new HyperLink();
if(TempControl is HyperLink)
{
Link = TempControl as HyperLink;
//Find out if session id already exists within the URL.
//If it does, lets not add it again.
int SessionPosition=Link.NavigateUrl.IndexOf("di=" + SessionId,0);
if (SessionPosition < 0)
{
int QMPosition = Link.NavigateUrl.IndexOf("?",0);
string UrlDelemeter;
//Determine what delimeter needs to be
//added before the session id
if(QMPosition > 0)
{
UrlDelemeter = "&";
}
else
{
UrlDelemeter = "?";
}
Link.NavigateUrl = Link.NavigateUrl + UrlDelemeter + "di=" +
SessionId;
}
}
if(TempControl.HasControls())
{
AddSessionIdToHyperLinks(TempControl.Controls);
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top