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.0Page_Load Runs TwicePage_Load Runs Twice
Previous
 
Next
New Post
9/10/2009 4:45 PM
 

<p>I am createing a custom module for DNN 5.1.1. My Problem is that the Page_Load even and OnInit is running twice.&#160; This is really slowing down my module load time as it has to run the same sql queries twice.</p> <p>&#160;</p> <p>Tryied turning AutoEventWireUp to false but all that does is not load the Page_Load event at all, then if I change the Page load to override (protected override void OnLoad) it runs it twice again.</p> <p>Also the first time threw (if I trigger a postback) the isPostBack boolean is set to true and the second time its not.</p> <p>&#160;</p> <p>Any Ideas on whats causeing the double load?</p>

 
New Post
3/22/2014 10:53 AM
 

I know this post is under 2.0 and is very old but there is no answer and it still shows up in search results and I have spent the last day trying to figure out the same thing and it was not wireup.

I am not sure why but for me it is caused if the page is initiated with a query string in the URL as a subfolder.  Like the page name is PAGE and the call is sitename/PAGE/3 then PAGE is invoked but the page load is invoked twice, not once when the /3 is included.  When the page is invoked with just PAGE and no /3 then the page load only executed once.  I am fairly new to dnn so am still figuring out the friendly URL thing.  I want PAGE/3 to execute PAGE and pass in the 3 but need the page load to only execute once.  There must be something in the friendly url arena that can help narrow this down even more for me. 

 
New Post
3/23/2014 9:16 PM
 

There are 2 ways the init or load event can fire twice.

The first obviously - is if there are two copies of a module loaded onto the page.

The second is if there is a redirect happening on the page - i would suggest you start with something like fiddler and see what is actually going on.

Also try using the debugger to see what the Request.RawUrl value is during each page load.

As a side thought - what is /PAGE/ is it just supposed to be a querystring field - try changing it to something else maybe - to see if something else on the page is not reacting to the PAGE value and causing a redirect.

Its possible another module is seeing PAGE and causing a redirect.

Westa

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Page_Load Runs TwicePage_Load Runs Twice


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