Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 open a new window when login
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

hellind
Junior Member

Singapore
123 Posts

Posted - 07 October 2003 :  04:05:17  Show Profile
When a user login to my site, it redirect them to the member-page, I also want it to open a new window. How do I insert the code into the login-page ?

I tried putting the following code before the redirect code, but it doesn't execute, perhaps because it's above the <html> tag. But It does redirect to abc.asp !

---------------------
<% if (a=b) then
%>
<script language="javascript">
window.open('im/messenger.asp');
</script>
<% response.redirect "abc.asp"
end if %>
----------------------

Another option I also tried is putting this code into the member-page. And I had to include a counter like "winopen = 1" to open only once, I dont' want it opening everytime the page is refreshed.

But it doesn't seem to work when ppl press the 'back' button to the member-page. It seems it runs the old generated code, opens the window again, without the checking with the server of "winopen = 1".

Are you understanding me ? :P

What's the solution ?

Help Appreciated.
bye

redbrad0
Advanced Member

USA
3725 Posts

Posted - 07 October 2003 :  10:15:50  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
You can not put the code before the redirect because it would never be run. The JS code would be run on the clients computer, but in the ASP code if you redirect then the server redirects and never sends the html which would have the JS code in it.

What you would have to do is run the JS script and then have the html code redirect after 1 second to abc.asp

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

hellind
Junior Member

Singapore
123 Posts

Posted - 07 October 2003 :  15:29:32  Show Profile
Cool !. thanks.... yea it works...


BUT...it there any better way without the ONE sec delay ?

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 07 October 2003 :  18:35:24  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
How about have in the JS that after it pops the new window it then forwards them to the new page and does not have to wait the second then.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07