javascript - redirect the users to default page (no login) if user navigates to the page directly by typing the URL -


i have asp.net 3.5 intranet website has default page menu , when user clicks on menu item, display page menu item in iframe embedded within default page. if user types url of page directly in browser, redirect him default page, because content pages not have menu. (master pages solve issue, can't use master page here reason , don't want go details). how find out if user has arrived @ page directly typing url or clicking on menu item, can decide whether redirect or not? possible find out? btw intranet site , no login required. in advance.

you should use masterpages problem, beacuse iframes not technique. but, try litte javascript-snippet in content pages:

<script type="text/javascript"> if (top == self)   window.location = "/index.html"; </script> 

you check, if loaded page identical iframe. if true, iframe loaded directly.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -