Article ID: 159977
Article Last Modified on 5/2/2006
Frameset Page (mainfrm.htm)
Frame 1 (frame1.asp)
Frame 2 (frame2.asp)
place the following code in frame1.asp or frame2.asp before the opening
<HTML> tag:
<%
If (Request.ServerVariables("HTTP_REFERER") = "") Or _
(Left(Request.ServerVariables("HTTP_REFERER"),42) <> _
"http://www.myserver.com/AppDir/mainfrm.htm") Then
Response.Redirect "http://www.myserver.com/AppDir/mainfrm.htm"
End If
%>
NOTE: You must put this code at the beginning of your document because "Response.Redirect" does not work if any HTML code occurs before it. For more information on this, please see the following article in the Microsoft Knowledge Base:
159402 How To Use Response.Redirect in a Server Script
Response.Redirect "http://www.myserver.com/AppDir/mainfrm.htm"
http://www.myserver.com/AppDir/mainfrm.htm.
<HTML>
<HEAD><TITLE>MAINFRM</TITLE></HEAD>
<BODY>
<FRAMESET ROWS="400,*">
<FRAME SCROLLING="no" NORESIZE SRC="frame1.asp">
<FRAME SCROLLING="no" NORESIZE SRC="frame2.asp">
</FRAMESET>
</BODY>
</HTML>
<%
If (Request.ServerVariables("HTTP_REFERER") = "") Or
(Left(Request.ServerVariables("HTTP_REFERER"),42) <>
"http://www.myserver.com/AppDir/mainfrm.htm") Then
Response.Redirect "http://www.myserver.com/AppDir/mainfrm.htm"
End If
%>
<HTML>
<HEAD><TITLE>FRAME1</TITLE></HEAD>
<BODY>
In Frame 1.
</BODY>
</HTML>
<HTML> <HEAD><TITLE>FRAME2</TITLE></HEAD> <BODY> In Frame 2. </BODY> </HTML>back to the top
Additional query words: 1.00 kbdsi
Keywords: kbaspobj kbcodesnippet kbhowto kbhowtomaster kbscript KB159977