IFrame Page_Load multiple time

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
 
R

Ryan Walberg, MCSD for .NET

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".
 
M

magister

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top