By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

Page_Load event fires twice in asp.net (C#) ?

P: n/a
Jon
Hi,

I've set up a new web form (new.aspx) that inherits a BasePage class.
The new web form contains an override Page_Load event. In BasePage,
Page_Load is declared 'virtual'. In the new web form, base.Page_Load
is called from within its Page_Load method so that both Page_Load
methods are executed.

AutoEventWireup is set to False, yet the page load and all following
code on the new web form is called twice. What am I doing wrong here?

Regards
Jon
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I had that problem before.

Here is scenario.

My page had an url http://www.mysite.com/page.aspx/param1
where param1 is the parameter
So when i had the image on the page <img src="img/my.gif"> browser will make
a second request for
http://www.mysite.com/page.aspx/img/my.gif
So Page_Load will execute twice.

I spent 3 hours to figuring out that problem :)

George.

"Jon" <to****@hotmail.com> wrote in message
news:e4*************************@posting.google.co m...
Hi,

I've set up a new web form (new.aspx) that inherits a BasePage class.
The new web form contains an override Page_Load event. In BasePage,
Page_Load is declared 'virtual'. In the new web form, base.Page_Load
is called from within its Page_Load method so that both Page_Load
methods are executed.

AutoEventWireup is set to False, yet the page load and all following
code on the new web form is called twice. What am I doing wrong here?

Regards
Jon

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.