IFrame Page_Load multiple time

  • Thread starter Thread starter magister
  • Start date Start date
M

magister

Hello

I have a default.aspx page with which has an iframe.

In the code-behind of the default.aspx page it loads the 'src'
attribute of the iframe.

The iframe loads another aspx page, but when it loads the Page_Load
method is called multiple times. In some situations the page is
called twice and in others it is called 4 times.

any ideas what might be going on here.

Thanks,
Matt
 
magister said:
Hello

I have a default.aspx page with which has an iframe.

In the code-behind of the default.aspx page it loads the 'src'
attribute of the iframe.

The iframe loads another aspx page, but when it loads the Page_Load
method is called multiple times. In some situations the page is
called twice and in others it is called 4 times.

any ideas what might be going on here.

Sure, you might have AutoEventWireup set to true, in which case it runs
Page_Load because it's an event handler, and then it runs it again
because it's called "Page_Load".
 
Thanks for your reply,

Nope AutoEventWireup="false" and Page_load event wired only once in

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}

However turning off smartnavigation in the page hosting the IFrame
sorted this one out...

Bummer, I wanted to use smartnav...
 
Back
Top