Launch Pop-Up from ASP

S

scott

From an asp page, i'm trying to auto-open a pop-up page if something exists.
I can do this within access via vba using below code.

Anyone know how I could modify the below js to auto-lauch from asp?

sPage = "javascript:
resizeTo(478,500);moveTo(130,150);document.location.href='http://myserver/myweb/mypopup.asp"
sApp = "c:\Program Files\Internet Explorer\iexplore.exe"

sCommand = sApp & " " & sPage & "'"

Call Shell(sCommand, 1)
 
B

Bob Lehmann

Even if you could get this to work, it would open a browser on the server.
Is that what you want?

You certainly can't run executables that are on a user's computer from a web
page - ASP or otherwise.

Bob Lehmann
 
S

scott

i just want my main asp page to open a pop-up page without having to click
anything.

this pop-up just exists to set a variable for the main page.

is this possible?
 
J

Jeff Dillon

You want it to pop up on the server? What if there is no one at the server
to see it?

Jeff
 
S

scott

Let me clarify what I'm doing. If you come to my homepage.asp and no cookie
is set that determines your language preference, I just want a pop-up to
launch allowing the user to select the preferred language.

Does that explain it better? I don't quite understand your question about
the server being there.
 
B

Bob Lehmann

You can't launch it from ASP. You could open a new window from the onload
event of the body tag, though. But, it would probably be blocked since alot
of people are disabling that functionality.

See a client-side scripting group for details.

Bob Lehmann
 
B

Bob Barrows [MVP]

You need to check the cookie in your server-side code and redirect the user
to another page if necessary. It is not possible to pop up a window from
server-side code. The only way to pop up a window is via client-side code,
which is NOT asp. If you wish to pursue a client-side code solution, then
post to one of the client-side newsgroups: the one most likely t help is the
..scripting.jscript group, although you may want to try one of the groups
with "dhtml" in their names.

Bob Barrows
 
S

scott

thanks guys.

Bob Barrows said:
You need to check the cookie in your server-side code and redirect the
user to another page if necessary. It is not possible to pop up a window
from server-side code. The only way to pop up a window is via client-side
code, which is NOT asp. If you wish to pursue a client-side code solution,
then post to one of the client-side newsgroups: the one most likely t help
is the .scripting.jscript group, although you may want to try one of the
groups with "dhtml" in their names.

Bob Barrows


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
 
B

Bob Barrows [MVP]

No, but you can read the value in your server-side code, and then
response.write it into your client-side code:

<%
dim serversidevalue
serversidevalue="3"
%>

<script>
valuefromserversidecode = "<%=serversidevalue%>"
//etc.
</script>

HTH,
Bob Barrows
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top