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  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
 


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.

 


The Standard in Senior Housing Information
SNAPforSeniors provides consumers with free online resources to assist them with their search for senior housing
www.snapforseniors.com
DotNetNuke Web Hosting w/ ASP.NET 3.5
Unlimited email boxes, Unlimited databases, Unlimited domains. Plans start at $4.97
www.MyWinHosting.com
SteadyRain
Founded in 1999, SteadyRain has extensive experience delivering Internet technology strategies and solutions for a diverse client base, ranging from Fortune 500 firms to successful start-ups.
www.steadyrain.com

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