Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0A question about the module lifecycleA question about the module lifecycle
Previous
 
Next
New Post
3/1/2007 4:56 AM
 

Hello:

I have a question that I thought I knew the answer to but am no longer sure.  I think there is also the good possibility that there is something sick on my development server (every since I installed .NET 3.0, LINQ and some other stuff, strange things have happened with .NET 2.0).

Say I have a module on a page.  The page is loaded, so the class is instantiated.  All class level variables are defined and assigned per the page init, page load, etc. 

I have a button on the module that says 'search'.  It performs a postback.  My question is this.  Is the class already instantiated?  So if I loaded something in the page_init the first time through, and I set a class variable 'bLoaded' = true, will that bLoaded still be equal to true on subsequent postbacks?

I know this sounds like a stupid question, but in debugging a module I've written, strange things are happening, like not getting postback events on clicks set with 'AutoPostBack=true', and class variables, which should have been set the first time through appear to have been reset as if the whole class was re initiated.

In short, what I'm asking is for someone to verify, yes or no, that if a page loads, then the module loads the first time, the module class remains instantiated until either session timeout or the user clicks on another page.  Correct?

Thanks for the help.

 

 
New Post
3/1/2007 11:10 PM
 

> will that bLoaded still be equal to true on subsequent postbacks?

No.  Each request re-instantiates a new object.

>  know this sounds like a stupid question, but in debugging a module I've written, strange things are happening, like not getting postback events on clicks set with 'AutoPostBack=true', and class variables

Sounds like you have module caching enabled

> In short, what I'm asking is for someone to verify, yes or no, that if a page loads, then the module loads the first time, the module class remains instantiated until either session timeout or the user clicks on another page.  Correct?

No.  Once the page is rendered and sent down to the client, all objects are lost (excluding session/application state of course).  Even if ASP.NET kept the objects, there is no guarantee that the next request from the browser will even be serviced by the same thread where the objects lived.


 
New Post
3/3/2007 7:50 AM
 
Thank you Jon.  Very clear.  I did, in fact, have module caching turned on.  Thanks.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0A question about the module lifecycleA question about the module lifecycle


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out