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

Random Redirect problem

P: n/a
I have a problem with a ASP.NET web site. I?m using Windows2000Server SP4, .NET Framework 1.1. The problem is that sometimes(relatively seldom) when browsing the Administration Console(see below) a redirect (unwanted and unexpected) is made to thePublic Site to a random page. Often (almost in every of thecases) the redirect is to a page of the UserPart of thePublicSite with a User logged in! I?m almost sure that the Userwas browsing the site in that moment. The redirect is made notonly from one Admin page.
The site is made around a CMS. Every page has base template,which has several placeholders. In every placeholder anUserControl can be put. The user controls are the elements ofthe pages ? Body, Navigation, Message board etc. Every page hasseveral records in the database holding the position and thecontent of the UserControls.
The site is divided in two parts ? Public Site and AdministrationConsole. The admin console contains the controls necessary toconfigure the public part.
The loading of the Public pages is done by a request to thedatabase. Every page has its own unique PageId which determineswhat to put on it. For example: Page = 5 has in placeholder 1 ?TopNavigation.ascx, placeholder 2 ? BreadCrumbs.ascx,placeholder 3 ? SideNavigation.ascx, placeholder 4 ? PageBody,placeholder 5 ? empty, placeholder 6 ? news.
The PublicSite has a part for the users, which can be read bylogging into the system (Forms authentication). There some ofthe user information (name, email, password etc) can be changedand there is also access to some private areas (the Forum forexample). After authentication an object containing some userinformation is created in the Session.
The Administration Console is also a CMS, but much more staticthan the Public Site. The public site has its own public.aspx,and the Administration Console its own console.aspx, but theyare in the same application.

--------------------------------
From: Valeri Hristov

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>KM2bOcfZq0eBFDhdnLh+sQ==</Id>
Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
check your use of static (shared or modules in vb) variables.

-- bruce (sqlwork.com)
"Valeri Hristov via .NET 247" <an*******@dotnet247.com> wrote in message
news:uS**************@TK2MSFTNGP11.phx.gbl...
I have a problem with a ASP.NET web site. I?m using Windows2000 Server SP4,
..NET Framework 1.1. The problem is that sometimes (relatively seldom) when
browsing the Administration Console (see below) a redirect (unwanted and
unexpected) is made to the Public Site to a random page. Often (almost in
every of the cases) the redirect is to a page of the UserPart of the
PublicSite with a User logged in! I?m almost sure that the User was browsing
the site in that moment. The redirect is made not only from one Admin page.
The site is made around a CMS. Every page has base template, which has
several placeholders. In every placeholder an UserControl can be put. The
user controls are the elements of the pages ? Body, Navigation, Message
board etc. Every page has several records in the database holding the
position and the content of the UserControls.
The site is divided in two parts ? Public Site and Administration Console.
The admin console contains the controls necessary to configure the public
part.
The loading of the Public pages is done by a request to the database. Every
page has its own unique PageId which determines what to put on it. For
example: Page = 5 has in placeholder 1 ? TopNavigation.ascx, placeholder 2 ?
BreadCrumbs.ascx, placeholder 3 ? SideNavigation.ascx, placeholder 4 ?
PageBody, placeholder 5 ? empty, placeholder 6 ? news.
The PublicSite has a part for the users, which can be read by logging into
the system (Forms authentication). There some of the user information (name,
email, password etc) can be changed and there is also access to some private
areas (the Forum for example). After authentication an object containing
some user information is created in the Session.
The Administration Console is also a CMS, but much more static than the
Public Site. The public site has its own public.aspx, and the Administration
Console its own console.aspx, but they are in the same application.

--------------------------------
From: Valeri Hristov

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>KM2bOcfZq0eBFDhdnLh+sQ==</Id>
Nov 18 '05 #2

P: n/a
Hi, I have similar problem but can't resolve it.

Lubo
Nov 18 '05 #3

P: n/a
Hello Bruce,
I tried to use as less as possible static variables, but there are
lots of static methods.
Actually the problem occurs in too many different locations and I
think the resolution may be in the configuration of the IIS or the
Framework. The site is large - 100k+ lines of code.

"bruce barker" <no***********@safeco.com> wrote in message news:<e2**************@TK2MSFTNGP12.phx.gbl>...
check your use of static (shared or modules in vb) variables.

-- bruce (sqlwork.com)

Nov 18 '05 #4

P: n/a
"Valeri Hristov" <va*********@yahoo.com> wrote in message
news:a1**************************@posting.google.c om...
Hello Bruce,
I tried to use as less as possible static variables, but there are
lots of static methods.
Actually the problem occurs in too many different locations and I
think the resolution may be in the configuration of the IIS or the
Framework. The site is large - 100k+ lines of code.


Valeri, you should not use writable static variables at all. At the very
least, you need to synchronize access to them. If you do not do this, you
_will_ see random errors which are very difficult to fix.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #5

P: n/a
As you see in the code below the static variable is initialized only
once. It is one of the few static variables (I ran a search thru the
project) and all have accessors and are read-only.
I'm concerned about the lots of static methods used to access the
database.
Nov 18 '05 #6

P: n/a
"Valeri Hristov" <va*********@yahoo.com> wrote in message
news:a1**************************@posting.google.c om...
As you see in the code below the static variable is initialized only
once. It is one of the few static variables (I ran a search thru the
project) and all have accessors and are read-only.
I'm concerned about the lots of static methods used to access the
database.


Static methods shouldn't be a problem. The problem would be static variables
being written from multiple threads. Another related issue would be static
variables being written by one user and then read by another.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.