Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Response.Redirect(...) & setting target

Response.Redirect(...) & setting target

Scheduled Pinned Locked Moved ASP.NET
databasehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrEyes
    wrote on last edited by
    #1

    Does anybody know if it is possible to set a target=_top parameter for a code behind Response.Redirect(..) That probably doesnt make much sense, so let me explain. A have a frameset (index.htm) that frames up two pages (navpage.aspx & main.aspx) when main.aspx is loaded or postsback in the Page_Load event it checks if a session variable is set if it isnt then I need to redirect to logon.aspx. At the moment I am doing this with the following code

    sObject = (SessionObject)Session["object"];
    if (sObject == null)
    {
    Response.Redirect("logon.aspx", true);
    }

    Now this works but the problem is that the redirection only occurs within the frameset so navpage.aspx is still displayed at the left of the page. What I need to do is display logon.aspx as _top. post.mode = postmodes.signature; SELECT everything FROM everywhere WHERE something = something_else; > 1 Row Returned > 42

    A 1 Reply Last reply
    0
    • M MrEyes

      Does anybody know if it is possible to set a target=_top parameter for a code behind Response.Redirect(..) That probably doesnt make much sense, so let me explain. A have a frameset (index.htm) that frames up two pages (navpage.aspx & main.aspx) when main.aspx is loaded or postsback in the Page_Load event it checks if a session variable is set if it isnt then I need to redirect to logon.aspx. At the moment I am doing this with the following code

      sObject = (SessionObject)Session["object"];
      if (sObject == null)
      {
      Response.Redirect("logon.aspx", true);
      }

      Now this works but the problem is that the redirection only occurs within the frameset so navpage.aspx is still displayed at the left of the page. What I need to do is display logon.aspx as _top. post.mode = postmodes.signature; SELECT everything FROM everywhere WHERE something = something_else; > 1 Row Returned > 42

      A Offline
      A Offline
      Alexandru Savescu
      wrote on last edited by
      #2

      You can do a hack as follows. Write a javascript that redirects as _top and from your page do like this:

      if (sObject == null)
      {
      Response.Clear ();
      Response.Write (myjavascript);
      Response.End ();
      }

      Regards, Alexandru Savescu

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups