Response.Write with QueryString and Target

S

sck10

Hello,

I am trying to redirect to a new URL using a query string and target. I can
not figure out how the syntax should be for setting the target. Any help
with this would be appreciated.
--
Thanks in advance,

sck10
Public strQuote As String = """"
Dim strTarget As String = "target=" & strQuote & "_blank" & strQuote
Response.Redirect("srcfinance.aspx?qv01=14&print=printme" & strTarget)
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

You can't use a target with Response.Redirect. When the page is executed
on the server, it's already decided where the resulting page will be loaded.

Either you have to use the target when the request is made, or you have
to output a page that contains Javascript that will set the location of
the window or frame where you want to load the page.
 
W

Walter Wang [MSFT]

Hi,

Thank you for your post!

Based on my understanding, you are trying to redirect to a page and want it
open in a new window.

It's not possible to do this in Response.Redirect, because frames and
windows are client-side concepts. The only possible workaround is the usage
of JavaScript. You can do a simple Response.Write inline with a JavaScript
call to window.open for the specified url. For example:

Response.Write("<script language=javascript>window.open('WebForm2.aspx',
'_blank');

Hope this helps. If anything is unclear, please feel free to post here.


Regards,
Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top