December 13th, 2008, 06:31 PM
Page_Init and Page_Load getting called twice
I have web application that uses a lot of user controls.
The problem i m facing is, the page_init and page_load events are getting called twice before the page gets rendered.
I tried searching on google, and found out that setting the AutoEventWireup="False" would solve the problem, but when i do this, the events are not called even once.
what should i do???
December 17th, 2008, 05:41 PM
Basically what autoeventwireup does is allow you to either manually bind events or allow VS to do it for you. if it is set to true then VS will add the Button1_Click() event for you and if it is false, you will have to bind it yourself.
Is any of your controls set to autopostback on change? For example, if you have a textbox that is set to postback when you hit enter and you click the submit button. that can cause it to be hit twice.
another possibility is that if you have a page passing control to another page by using server.transfer instead of response.redirect could yield your double init and load
I believe in making the world safe for our children, but not our childrenís children, because I donít think children should be having sex. -- Jack Handey