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

code help with asp and frames

Status
Not open for further replies.

dorling

Technical User
Mar 25, 2004
80
GB
hi there,

if i go to the address index.asp?cat=news

i can use the code:

Code:
<% Response.Write(cat) %>

and this will write out news in this example

but how can i do this if i am using frames i try this

Code:
<frameset rows="160,*" frameborder="NO" border="0" framespacing="0">
  <frame src="home/menu.asp" name="topFrame" scrolling="NO" noresize>
<%response.write("<frame src='" & request.querystring("cat") & "/main.asp' name='mainframe'>")%>
</frameset>

but this does not take the cat information to the page i need it to??

How can i do this

thanks in advance

Jonathan D
 
If you browse to index.asp?cat=news and index.asp contains the frameset code below then I see no reason why it shouldn't work...
Code:
<frameset rows="160,*" frameborder="NO" border="0" framespacing="0">
  <frame src="home/menu.asp" name="topFrame" scrolling="NO" noresize>
<frame src="<%=request.querystring("cat")%>/main.asp" name="mainframe">
</frameset>

Tony
________________________________________________________________________________
 
this work thanks a lot

just one last problem now

basic

if someone type in index.asp there is no cat and so i need the cat to equal home so i try this code below but it does not work i think it to do with the if command gettin the cat any help will help me thanks a lot

Code:
<%@ Language="VBScript" %>
  <% Option Explicit %>

<HTML>
<HEAD>
<TITLE>ASP Test Page</TITLE>
<% If request.querystring("cat") is null Then 
cat = "home"
else
%>	
</HEAD><BODY>
<p><h1>
<% response.write(request.querystring("cat")) %>
</h1></p>

</BODY>
</HTML>

thanks in advance

Jonathan D
 
use this...
Code:
<%
If Request.Querystring("cat") <> "" Then
  strCat = Request.Querystring("cat")
Else
  strCat = "home"
End If
%>
<frameset rows="160,*" frameborder="NO" border="0" framespacing="0">
  <frame src="home/menu.asp" name="topFrame" scrolling="NO" noresize>
<frame src="<%=strCat%>/main.asp" name="mainframe">
</frameset>

Tony
________________________________________________________________________________
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top