Order of script

  • Thread starter Thread starter AGB
  • Start date Start date
A

AGB

Hi all,

I have a problem. I have a submit button on a form that runs a bunch
of server-side code behind code. However, I realize that when that
code is complete I need to pop-up a a new form with some general text.
Nothing too complex.

So, since I cannot create a pop-up from the server, how do I get my
button submit method to run and then get javascript to run to pop up
the new window?

Thanks

A
 
Hi AGB, use Page.RegisterStartupScript Or Page.RegisterClientScriptBlock to
inject the javascript / function call into the html page output HTH jd
 
But that still leaves me having to call the JS function from my button
which means my button's submit method on the server never runs...or am
I missing something

?
 
Hi AGB Add the call after you have done the server work. this will then
return you to the form but also insert the script. when the form (re)loads if
then fires your popup window i.e

sub button_click(o as object, e as eventargs) handles button.click

' process button click

dopopup()

end sub

sub dopopup()
Page.RegisterStartUpScript("popup", "<Script>mywin =
window.open('thankyou.aspx', 'popup'); mywin.focus()</script>")
end sub

HTH jd
 

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

Back
Top