Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading a page in the browser window not a frame

Client Side ASP

Loading a page in the browser window not a frame

by  Zarcom  Posted    (Edited  )
I have found a few people are looking for an example of this. Myself and others I know have had problems getting a page in a framset to redirect to the login page correctly. The problem was that the login page would load in the frame that called it rather than the entire browser itself.
I found a solution in the exact opposite place I was looking for. Put the following code into the login page itself.

Somewhere near the top of the page enter this script either manually or with the RegisterStartupScript method in your code behind.
[color green]
<SCRIPT LANGUAGE="javascript">
<!--

if (window.top != window.self)
{
window.top.location="login.aspx";
}
//-->
</SCRIPT>
[/color]

Hopefully this can save someone the hours it cost me.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top