Deny Access To A Page

G

Gene

What are some ways I can deny access to an aspx page other than removing it
altogether from the site? I need the ability to temporarily prevent all
users from accessing certain pages.

Thanks.
 
C

Cowboy \(Gregory A. Beamer\)

Set up a <location> region in your web.config for each of those pages and
set authentication to where all users are denied.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
P

Peter O'Reilly

Set a database or session state derived flag and have those pages check the
flag in the Page_Load event. Redirect to another page as necessary.
 
G

Gene

Sounds like a great option. Suppose I make only one change to Web.config
(add a page to the <location> region): would the only effect be that any
subseqeunt requests for the page are denied? Are existing sessions left
intact?
 
C

Curt_C [MVP]

any modification to the webconfig causes the site to reload. everything is
dumped/restarted so to speak
 
C

Cowboy \(Gregory A. Beamer\)

Curt is correct. Also, note that anyone trying to reach the page will still
be "able" to reach it, just denied access. If you have links to the page(s)
in question, it should be considered a "programming" bug.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top