fuseboxx
08-29-2005, 12:35 PM
Hi - I have a simple script that I use to open a file in a frameset based on the variable passed in the URL. What it does is take the URL= variable and set that as the main frameset. The only problem is if the page doesn't exist I get a 404 error.
I'd like to enhance it a bit more and if the file doesn't exist I would also like to set the URL Variable to my main.htm page.
I know in JavaScript you check for the existence of the file, but I'm not sure what the.asp code is to validate this ---- Would appreciate any guidance - the script is below
********************************************************
<%@LANGUAGE="VBSCRIPT"%>
<% If Request.QueryString("URL") = "" Then URL = "welcome.htm" Else URL = Request.QueryString("URL") End If %>
<html>
<head>
<title></title>
</head>
<frameset framespacing="0" border="false" frameborder="0" rows="85,*">
<frame name="top" scrolling="no" src="top.htm" marginwidth="0" marginheight="0" target="main">
<frame name="main" src="<%= URL %>">
<noframes>
<body>
text Here
</body>
</noframes>
</frameset>
</html>
I'd like to enhance it a bit more and if the file doesn't exist I would also like to set the URL Variable to my main.htm page.
I know in JavaScript you check for the existence of the file, but I'm not sure what the.asp code is to validate this ---- Would appreciate any guidance - the script is below
********************************************************
<%@LANGUAGE="VBSCRIPT"%>
<% If Request.QueryString("URL") = "" Then URL = "welcome.htm" Else URL = Request.QueryString("URL") End If %>
<html>
<head>
<title></title>
</head>
<frameset framespacing="0" border="false" frameborder="0" rows="85,*">
<frame name="top" scrolling="no" src="top.htm" marginwidth="0" marginheight="0" target="main">
<frame name="main" src="<%= URL %>">
<noframes>
<body>
text Here
</body>
</noframes>
</frameset>
</html>