Loading page within Frameset

Results 1 to 2 of 2

Thread: Loading page within Frameset

  1. #1
    Join Date
    Dec 1969

    Default Loading page within Frameset

    Hi,<BR><BR>The site I run functions in frames. However, when a user searches in say, Yahoo!, there is often a direct link to the page itself outside of the frames. I have used the code below...<BR><BR> &#060;%<BR> If (Request.ServerVariables("HTTP_REFERER") = "") Or _<BR> (Left(Request.ServerVariables("HTTP_REFERER"),42) &#060;&#062; _<BR> "http://www.myserver.com/AppDir/mainfrm.htm") Then<BR> Response.Redirect "http://www.myserver.com/AppDir/mainfrm.htm"<BR> End If<BR> %&#062;<BR><BR>...to redirect to the fraemset page, however, this page is the index page and opens my homepage in the frame called &#039;main&#039;.<BR><BR>I was wondering if there is a way to set it up so that the a direct page linked via Yahoo!, for example, opens into the &#039;main&#039; frame?<BR><BR>A lot of those pages are calling data from a database and so if someone directly went to a page such as &#039;reviews?item=1197&#039; could the frameset load up with this in the correct frame?<BR><BR>Hope that makes sense..:}

  2. #2
    Join Date
    Dec 1969

    Default RE: Loading page within Frameset

    Put a bit of JS at the top:<BR>&#060;script&#062;<BR>if(top.location.href ==self.location.href){<BR> // Here, we&#039;re not in a frameset.<BR> top.location.href=&#039;/index.asp?myPage=&#039; + escape(self.location.href);<BR>}<BR>&#060;/script&#062;<BR><BR>Then, in index.asp, make it check for the querystring parameter "myPage". If it finds it, make it load that in the frameset instead.<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts