By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,663 Members | 1,477 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,663 IT Pros & Developers. It's quick & easy.

Require Frameset

P: n/a
I have some pages that open in a frameset. I want them to be opened *only*
in the frameset (and not on their own). How can I disallow a page from being
opened on its own (i.e., allow to be opened only when from within frameset)?

Thanks!

-G
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
you will have to resort to javascript for this. asp.net doesnt have the
concept of frames and the page has no information on whether it is loaded in
a frame or on a normal window (either way a frame is just a window)
if (parent.frames.length = 0) {
parent.location.href = "your_frameset.aspx or html page"
}
--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:eq*************@TK2MSFTNGP11.phx.gbl...
I have some pages that open in a frameset. I want them to be opened *only*
in the frameset (and not on their own). How can I disallow a page from being opened on its own (i.e., allow to be opened only when from within frameset)?
Thanks!

-G

Nov 18 '05 #2

P: n/a
Have your page make sure that it's within a frameset. If it's not, it can
redirect to the frameset page.
MSDN's site does this pretty well.
From looking at their source code they do it with client side javascript
code:
if (self == top) ...

View the code yourself:
http://msdn.microsoft.com/library/default.asp
(right click in the bottom right frame and do a view source.)

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:eq*************@TK2MSFTNGP11.phx.gbl...
I have some pages that open in a frameset. I want them to be opened *only*
in the frameset (and not on their own). How can I disallow a page from
being
opened on its own (i.e., allow to be opened only when from within
frameset)?

Thanks!

-G

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.