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

problems with response.redirect 1

Status
Not open for further replies.

conjurer111

Programmer
Aug 11, 2002
76
IN
Hi,

I have an ASP page where in I'm having a select case structure. For all cases excepting one, the page submits to itself where as for one particular case, I do a response.redirect to another ASP page. The problem is that I need to open the called page in a new window rather than it overlapping the same window. I can't seem to figure out how to pass the target frame for the new window. Any workarounds to this issue ? Thanks.

Following is the code -

Code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
</HEAD>
<FORM NAME=&quot;theForm&quot; METHOD=&quot;post&quot; ACTION=&quot;schemewise.asp&quot;>
<%
if Request.Form.Count =0 then 
	session(&quot;fla&quot;)=1
end if	

flag = session(&quot;fla&quot;)

   Select case(flag)

     Case 1  

	session(&quot;fla&quot;)=2
	response.write(flag)

     Case 2  
	
	session(&quot;fla&quot;)=3
	response.write(flag)

     Case 3  

	session(&quot;fla&quot;)=4
	response.write(flag)

     Case 4  

	session(&quot;fla&quot;)=5
	response.write(flag)


     Case 5  
	response.redirect (&quot;../reports/nonplan_default1.asp&quot;)
   End Select

%>
<BODY>

<br><br><br><br><br>
<P><INPUT id=submit1 type=submit value=Submit name=submit1></P>
</BODY>
</HTML>
 
first of all response.redirect wont work after any output is given to the HTML file (ASP is converted to plain html by the server)


as for a new window try this:

scr=&quot;&quot;
flag = session(&quot;fla&quot;)

Select case(flag)

Case 1

session(&quot;fla&quot;)=2
response.write(flag)

Case 2

session(&quot;fla&quot;)=3
response.write(flag)

Case 3

session(&quot;fla&quot;)=4
response.write(flag)

Case 4

session(&quot;fla&quot;)=5
response.write(flag)


Case 5
scr=&quot;<script>function OpenWindow(){window.open('../reports/nonplan_default1.asp')}</script>&quot;
response.write scr
End Select
%>

<BODY <%if scr<>&quot;&quot;%>onload=&quot;OpenWindow()&quot;<%end if%>>

<br><br><br><br><br>
<P><INPUT id=submit1 type=submit value=Submit name=submit1></P>
</BODY>
</HTML>


this script will open a new window.

hope this helps
 
Hi VBKRIS,

thanks a lot! It works like a charm. Will get back in case I need some more clarifications.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top