Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  custom control Page_init and page_load seem to run twice
Previous Previous
 
Next Next
New Post 6/11/2007 9:42 PM
User is offline quintin humphreys
26 posts
10th Ranked


custom control Page_init and page_load seem to run twice 

Hi Guys

Im building a custom control and it seems that my page_init and page_load functions seem to run twice.  would there be any explanation for that?  i have never developed controls outside of DNN before so i dont know if this is standard procedure.

i have a routine that i run from page_init that adds columns to a datagrid, because of this phenomenon it adds twice as many columns as necessary because it adds them twice (each time page_init is run)

Please help me!

Q

 
New Post 6/19/2007 3:01 AM
User is offline Markus Hamburger
8 posts
10th Ranked




Re: custom control Page_init and page_load seem to run twice 

Hi quintin79,

I don't know why but sometimes .NET calls the Page_Load and Page_Init twice, when they are inherited from Page.
Try to use overwriting onLoad and onInit (with base calls to MyBase.onLoad and Mybase.OnInit) instead of using Page Events. That has helped me in the past and the events are now called only once.

Before:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

After:
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
    MyBase.OnLoad(e)


Markus Hamburger

DeutschNetNuke

 
New Post 10/29/2007 9:10 AM
User is offline Will Ballard
42 posts
www.ingensystems.com
10th Ranked


Re: custom control Page_init and page_load seem to run twice 

What version of DNN are you running?


Will Ballard
Ingen Systems
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  custom control Page_init and page_load seem to run twice
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Aricie
Aricie is one of the French pioneers and experts in DotNetNuke technology.
www.aricie.com
AFUEGO!
Looking for Free DNN Hosting?
www.AFUEGO.com
Code 5 Systems, LLC.
The DNN Missing Link: A Form Module. Form Master 1.6 is an intuitive Form Creation Module at a great price. Quality Custom Module development, and DNN consulting services.
www.code5systems.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP