Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jun 2003
    Location
    Indiana, USA
    Posts
    141
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Post

    I have an error page that is displayed via a redirect code, that is used when someone is trying to access a secure area of my web site, or when the site "times out" based on inactivity. My site is a 2-frame style, menu on the left, and the main content on the right side. Here is my code:

    Response.Expires = -1000
    Response.ExpiresAbsolute = Now() - 1
    If Session("UserName") = "" then
    Response.Redirect ("unauthorized.asp")
    Response.End

    When the unauthorized.asp page is displayed, it does so in the right hand frame, just like all other page. In essence the web site is then inaccessible until the user logs back in, or leaves for another site. However the menu side of the site is still visible, and even though the use can click on the each of the menu selections, they cannot access the site.

    I wouldl like to make the site a little cleaner (i.e. professional looking) and make the unauthorized.asp "full page", and not have the menu frame. Any help would be greatly appreciated.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    [quote name='SmokeEater' post='770487' date='14-Apr-2009 10:14']When the unauthorized.asp page is displayed, it does so in the right hand frame, just like all other page. In essence the web site is then inaccessible until the user logs back in, or leaves for another site. However the menu side of the site is still visible, and even though the use can click on the each of the menu selections, they cannot access the site.

    I wouldl like to make the site a little cleaner (i.e. professional looking) and make the unauthorized.asp "full page", and not have the menu frame. Any help would be greatly appreciated.[/quote]
    I think you will need to use client-side script for this: there's no way for the server to do it alone.

    I don't have the code myself, but it is not an uncommon request to prevent pages from being framed. If you search the web, you probably will find a number of different ways to detect that a page is framed, and then to reload the page so that it takes over the whole window/tab.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    Could you use something similar to this instead of Resonse.Redirect:

    [codebox]
    <%
    url = "unauthorized.asp"
    response.write("<script>" & vbCrLf)
    response.write("parent.framename.location.replace( '" & url & "');")
    response.write(vbCrLf & "</script>")
    %>
    [/codebox]

    This at least allows client-side coding, just an idea
    Jerry

Posting Permissions

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