AllowPageToBeOpenedBySpecifiedPage

  • Thread starter Thread starter gh
  • Start date Start date
G

gh

I have an HTML page that is being opened by a button on an ASPX page.
In the head of the html page I would like to place some js to see if the
aspx page(url) is the one that called it, if so open it, if not do not
allow the html page to be displayed. Does anyone know the js for this?


TIA
 
You are after the javascript document.referrer metod. However, if you are
opening this from asp.net - why not make sure the button click is actioned
on the server and only load the page if its from that click event, falling
back to document.referrer in case someone ahs the URL of the htm page.
Better still, dont worry about were it came from and make sure its got some
security on the directoty the html file lives in so only people allowed to
see it can see it.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
Back
Top