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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open new window based on write.response

Status
Not open for further replies.

msingle

MIS
Jul 15, 2002
22
0
0
US
What am I fumbling here?? I don't want to resort to javascript. Is there a way to open a new window using this code.... perhaps and .inc file?

<html>
<body>
<%
Select Case Request.QueryString(&quot;resolution&quot;)
Case &quot;newframe&quot;,&quot;&quot;
target=&quot;_blank&quot;
Case &quot;fullframe&quot;,&quot;&quot;
vWidth=&quot;100%&quot;
vHeight=&quot;100%&quot;
Case &quot;320x240&quot;
vWidth=&quot;320&quot;
vHeight=&quot;240&quot;
Case &quot;640x480&quot;
vWidth=&quot;640&quot;
vHeight=&quot;480&quot;
End Select
 
You will have to resort to javscript.
Maybe you form the url for window.open in the select..case according to which case it is and then use this code.
<%
url = &quot;response.write(&quot;<script>&quot; & vbCrLf)
response.write(&quot;window.open('&quot; & url & &quot;');&quot; & vbCrLf)
response.write(&quot;</script>&quot;)
%>
 
Ok... maybe some javascript... how would I go about doing that? I tried, but with the sample code listed before, the ASP page gives and error.
 
If your intetion is to open the new window with the dimensions from your select statement try this:

<%
Select Case Request.QueryString(&quot;resolution&quot;)
Case &quot;newframe&quot;,&quot;&quot;
target=&quot;_blank&quot;
Case &quot;fullframe&quot;,&quot;&quot;
vWidth=&quot;100%&quot;
vHeight=&quot;100%&quot;
Case &quot;320x240&quot;
vWidth=&quot;320&quot;
vHeight=&quot;240&quot;
Case &quot;640x480&quot;
vWidth=&quot;640&quot;
vHeight=&quot;480&quot;
End Select

url = &quot;
response.write(&quot;<script language='javascript'>&quot;)
response.write(&quot;window.open('&quot; & url & &quot;'
,null,
'resizable,scrollbars,width=&quot; & vWidth & &quot;,height=&quot; & vHeight & &quot;');return false;)&quot;
response.write(&quot;</script>&quot;)
%>

It may not look as pretty from the code side but it should work!

Enjoy...

ProgrammingJunkie
:)
 
You can try using this....it was generated by DWMX
--------------------------------------------------
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body>
<a href=&quot;#&quot; onClick=&quot;MM_openBrWindow('POPwindow.asp','popWINDOWname','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=100,height=100')&quot;>CLICK ME</a>
</body>
</html>

-----------------------------------------------------------
I hope this helps....you can always edit Java to your needs. I don't know why do you reject java...this java is harmless and cross-browser
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top