I have a small problem using both client side events (with javascript) and server side events for a button. The button is located in a popup. in the client side onclick event I have specified that the parent form should reload and the popup should close itself,
works fine. in the server side event I update some things in a database. now the parent form shows those information of the database. my problem is that the clientside script is called _before_ the server side event (which means before the database is updated).
as a consequence, when the popup is close, the view of the data in the parent form is not up to date. Is there a way to fix this? Greetings, Dora
The page in your popup posts back to the server to update the database. The client-side code to refresh the parent window and close the popup could be added at this point, so that it fires automatically (document's onload event): [C#]
thx I used a third page to close and refresh the other but a bit differently. When needing to close the popup and refresh the parent I redirect to the third page. The third page immeadiately closes itselft and refreshes the parent with javascript. Greetings,
Dora
pisschrist
Member
340 Points
68 Posts
Javascript onclick and Button's onlick events.
Oct 09, 2003 01:40 PM|LINK
stevenbey
All-Star
16526 Points
3378 Posts
Re: Javascript onclick and Button's onlick events.
Oct 09, 2003 03:08 PM|LINK
http://stevenbey.com
Recursion: see Recursion
pisschrist
Member
340 Points
68 Posts
Re: Javascript onclick and Button's onlick events.
Oct 10, 2003 12:03 PM|LINK
stevenbey
All-Star
16526 Points
3378 Posts
Re: Javascript onclick and Button's onlick events.
Oct 10, 2003 12:50 PM|LINK
<script runat="server"> public void Page_Load ( Object src, EventArgs eArgs ) { if ( IsPostback ) { Body.Attributes [ "onload" ] = "opener.refresh(); close();" } } </script> ... ...http://stevenbey.com
Recursion: see Recursion
pisschrist
Member
340 Points
68 Posts
Re: Javascript onclick and Button's onlick events.
Oct 15, 2003 08:52 AM|LINK