Submitting iframe problem.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to submit an iframe from the parent window using javascript. It
works correctly the first time but after that the submit doesn't work.

I call the javascript code {parent.framename.document.forms[0].submit();}
when I click the button on the parent.

On the first click of the button I get the following events.

LoadViewState();
Page_Load Page.IsPostBack
SubmitClicked ---- The event I'm looking for.
Page_Load !Page.IsPostBack

On any subsequent clicks of the button, I get the following event.

Page_Load !Page.IsPostBack

if I put an alert() in the javascript function(), it works every time.

Anybody have any ideas?
 
The problem is fixed. The problem was that I was calling
Page.RegisterStartupScript() during a !Page.IsPostBack() to generate the
script and the script was being lost by .Net after the first submit. I then
moved the Page.RegisterStartupScript() to Page_Load under any condition and
it worked ok for IE but Netscape still lost the StartupScript() after the
first submit. So I then hardcoded the script into the aspx file and it worked
ok on both IE and Netscape. The original implementation should have worked
since I Response.Redirect(parent) from the Submit event which should cause a
!Page.IsPostBack() to reregister the Startup Script. However, for some
reason, .Net disregards the redirection when the submit is done from the
parent. That's another thread.
 
Back
Top