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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to block user directly access *.aspx file in virtuedirectory

Status
Not open for further replies.

theresatan

Programmer
Mar 18, 2002
101
US
Hi,All

I have a secret.aspx page located in virtue directory and I want user access this page by login, then login page will redirect user to this secret.aspx page. I don't want them directly access this page.

I took off the "Read" property from this file located on virtue directory, but I still can access this page by type fillowing in IE5.5:
" .

If I put secret.htm on same virtue directory and took off the "Read" property from that file located on virtue directory, I got "The page cannot be displayed" message by type following in IE5.5.
"How to make .aspx file have the same effect with .htm file.

I appreciate your imput.

Theresa
 
Hey Theresa,

One way to do it would be to create a boolean value in a session set to True if the user is logged in, false if not. Then on your "secret" page, in the page load have code that will check this session and see if its 'True'. If not, redirect to some other page. Else, let them see it.

If someone tries to access the page directly, unless the session variable has been created on the server and is True, the code should catch that it isn't 'True' and redirect as well.

We came up with a similar scheme for security in the web portal we've been building for our client, and it works pretty well.

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top