473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Order of script

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

Nov 19 '05 #1
4 858
Hi AGB, use Page.RegisterStartupScript Or Page.RegisterClientScriptBlock to
inject the javascript / function call into the html page output HTH jd

"AGB" wrote:
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

Nov 19 '05 #2
AGB
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

?

Nov 19 '05 #3
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
"AGB" wrote:
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

?

Nov 19 '05 #4
AGB
Got it. Thanks a ton.

AGB

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
3
by: Daniel Ruscoe | last post by:
Hi chaps, I'm relatively new to the language, but I want to create a simple order form using PHP and cookies. Please let me know if there's a better way in this situation, database isn't...
18
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
2
by: david | last post by:
Hi, I have a form with 2 select objects which are not linked together in any way. The list exactly the same information. The code that generates the data is: ...
1
by: aRTx | last post by:
<? /* Directory Listing Script - Version 2 ==================================== Script Author: Artani <artan_p@msn.com>. www.artxcenter.com REQUIREMENTS ============ This script requires...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.