Forum Moderators: open

Message Too Old, No Replies

Forcing postback on ASP.NET

I need to force postback from a html page to a parent webform

         

mrfori

5:58 am on Dec 1, 2003 (gmt 0)

10+ Year Member



Hi Guys,

I using visual studio .net to create a ASP.NET application.
I have a webform that opens a html page via window.open('loancalculator.html');

When users press the calculate button on the child window (loancalculator.html) the page updates the value on a text control on the parent webform.aspx via window.opener.control.value = newvalue

All the above seem to work. On my webform I have other webcontrols which values are dependent of this control I just changed. But their value dont changed.

Basically IE dont consider window.opener.control.value = newvalue good enough to call my onChange() method on that control.

I need to manually force a PostBack on the webform.]

Any suggestions?

Thanks a lot

korkus2000

6:43 pm on Dec 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What input are you updating asp:textbox or input type="text"? Have you tried just a plain submit of the form?

mrfori

12:44 am on Dec 2, 2003 (gmt 0)

10+ Year Member



Ohh Thanks a lot korkus,

Yeah just plan form.submit() forced a postback. I was updating and asp:text control.

jdaniels3110

4:26 pm on Dec 29, 2003 (gmt 0)

10+ Year Member



How did you submit the form on the opener page? Any help would be much appreciated. Thanks

jdaniels3110

5:17 pm on Dec 29, 2003 (gmt 0)

10+ Year Member



I have it working now. Thanks. Here is my code.

Dim strScript As String = "<script>window.opener.document.forms[0].submit();"
strScript += "self.close()</script>"
RegisterClientScriptBlock("anything", strScript)