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)
 how to use target with response.write
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Angela French
Starting Member

5 Posts

Posted - 17 April 2002 :  19:29:51  Show Profile
I have two browser windows open on the desktop. One is a full screen, one is a popup.

I have this line of code:

response.redirect ("findClient.asp?error=invalid")

I need it to load in a popup box(findClient.asp) instead of the fullscreen . I need something like a target attribute here, but don't know how to do it inside the response.write.

Can someone please help me, I pulling my hair out on this one.



Nikkol
Forum Moderator

USA
6907 Posts

Posted - 17 April 2002 :  19:52:30  Show Profile
if you are wanting to do a popup window, it would be easier to use javascript.

Nikkol
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 17 April 2002 :  20:07:37  Show Profile  Visit Nathan's Homepage
ASP is server side, you cant influence content in another client side window.

Nathan Bales
Snitz Exchange | Do's and Dont's
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 17 April 2002 :  22:47:55  Show Profile  Visit Gremlin's Homepage
The pureists will flame me for this, but it is a solution.

You could of course set a Session variable immediately before the Response.Reidrect and then query this in the page that is redirected to. ie

Session("ErrorVal") = "invalid"
Response.Redirect "findclient.asp"

Then in findclient.asp instead of checking the querystring e.g

if Response.Querystring("error") = "invalid" then .....

Check the Session or App variable instead

if Session("ErrorVal") = "invalid" then ...

Don't forget to destroy or reset the Session object if thats what you use (also note Session Variables don't work on the client unless Cookies are enabled)

www.daoc-halo.com
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 18 April 2002 :  10:14:44  Show Profile
Gremlin, forgive me if I do't understand your code but how is that going to open the findclient.asp page in the specific window that she wants to open the page in? She wants to open the page using the "target=xxx" attribute.

It seems you are passing the "error=invalid" from the querysting to using a session variable to pass it. But I don't think that's what she wants to do. Passing the variable in the querystring will work ok though.

As Nikkol and Nathan suggested, you can't do that using Response.Write. You can create a javascript function or vbscript function that will open it in the new window. Or you can Response.Write an <a href tag that has the target attribute included.

«------------------------------------------------------»
Want to know when the next version comes out,
as soon as possible? Join our Mailing Lists !
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 18 April 2002 :  18:56:44  Show Profile  Visit Gremlin's Homepage
Forgive me, I was running late for a meeting and didnt really help you much did I.

Change the Response.Reidrect to the following code

Response.Write "<SCRIPT LANGUAGE=""javascript"">" & vbCrLf
Response.Write "<!--" & vbCrLf
Response.Write "window.open(""findclient.asp"",""NewWindow"")" & vbCrLf
Response.Write "-->" & vbCrLf
Response.Write "</SCRIPT>" & vbCrLf


I don't think you can pass the error querystring though in this manner so the Session idea in my previous post helps with this part of it.



www.daoc-halo.com
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 19 April 2002 :  10:39:41  Show Profile
It should be able to Gremlin. I don't think you are restricted to what url you can open with using javascript.

«------------------------------------------------------»
Want to know when the next version comes out,
as soon as possible? Join our Mailing Lists !
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 20 April 2002 :  11:44:12  Show Profile  Visit Gremlin's Homepage
Your bound to be right :), I had had a problem passing a string through with a jscript popup type window before so wasn't too sure.

www.daoc-halo.com
Go to Top of Page

XavierSlater
Junior Member

United Kingdom
137 Posts

Posted - 22 April 2002 :  19:06:30  Show Profile  Visit XavierSlater's Homepage
I am looking at a similar problem.

I need the following code to open a new window, with the variables passed to it.

quote:

' redirect to new frame window and create a new user login
Response.Redirect("frames.asp?chatId=" & p.id)
Response.End



This is ConquerChat, but for my site I need it to open in a new window....

Thoughts?

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 22 April 2002 :  22:37:06  Show Profile  Visit Gremlin's Homepage
Try what I posted above and add the querystring on to it e.g


Response.Write "<SCRIPT LANGUAGE=""javascript"">" & vbCrLf
Response.Write "<!--" & vbCrLf
Response.Write "window.open(""frames.asp?chatId=" & p.id & """,""NewWindow"")" & vbCrLf
Response.Write "-->" & vbCrLf
Response.Write "</SCRIPT>" & vbCrLf



www.daoc-halo.com

Edited by - Gremlin on 22 April 2002 22:38:08
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.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07