Re: custom base classes
- From: "Chris Fulstow" <chrisfulstow@xxxxxxxxxxx>
- Date: 6 Apr 2006 08:37:52 -0700
Hi Matt,
Each time a page request is made the ASP.NET Page object is recreated,
so any instance values that were set in the previous request will be
lost. It's possible to get around this by using static class
properties, however these will be lost when the application domain is
recycled, which happen by default every 29 hours, and whenever you
modify web.config. This approach is not considered best practice for
maintaining state across page requests.
Better approaches would be to use the Session object, cookies or the
viewstate, depending on your requirements. For maintaining
application-wide data, consider using a database or the Cache object
(in preference of the Application object). If you want to persist
state data for individual users, take a look at using ASP.NET 2.0
profiles.
Hope that helps,
Chris
.
- Follow-Ups:
- Re: custom base classes
- From: matt . delvecchio
- Re: custom base classes
- References:
- custom base classes
- From: matt . delvecchio
- custom base classes
- Prev by Date: RE: Reference A var on Master Page from User Control
- Next by Date: Re: How to get value of QueryString inside QueryString
- Previous by thread: custom base classes
- Next by thread: Re: custom base classes
- Index(es):
Relevant Pages
|