Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open a new window from asp 1

Status
Not open for further replies.

Brench

Programmer
Aug 10, 2001
2
GB
I need to open a new window from asp.
After logging in i want to redirect from the login page AND display a popup window. I dont want to add java script to the page i redirect to as as this page is called from a number of places and i want to avoid the mess.

Any Ideas?
 
If you want to do a popup, you're going to have to use some client side scripting (ie - javascript). You can change the location of the browser window with server side scripting, but not open a new window.
penny.gif
penny.gif
 
Why don't you try something like this.

You use ASP to validate login and decide what do next, then when you are ready to allow the user to continue you use client-side javascript to open up the popup and redirect to the next page.

Code:
<%
login_result = validate_login_function
select case login_result
case login_result = &quot;success&quot;
    redirect_sub
case login_result = &quot;failed&quot;
    login_sub
case login_result = &quot;not_logged_in_yet&quot;
    login_sub
end select

sub redirect_sub

response.write(&quot;<script>&quot; & vbcrlf)
response.write(&quot;window.open('popup.asp'); & vbcrlf&quot;)
response.write(&quot;window.location= 'next_page.asp';&quot; & vbcrlf)
response.write(&quot;</script>&quot; & vbcrlf)

end sub

sub login_sub

'build your login form
end sub
...
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top