Deny Access To A Page

  • Thread starter Thread starter Gene
  • Start date Start date
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.
 
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!
**********************************************************************
 
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.
 
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?
 
any modification to the webconfig causes the site to reload. everything is
dumped/restarted so to speak
 
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!
**********************************************************************
 
Back
Top