Forms Authentication

J

Jeff

Rather than declaratively specifying that a particular aspx page is to be
secured by Forms Authentication, as in the following code from Web.config:

<location path="mySecuredPage.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

Is it possible to programmatically determine if/when a page is to be secured
by Forms Authentication (i.e., at runtime per my own custom logic)?

What I ultimately want is the ability to require users to be authenticated
before viewing a page (or to not be authenticated before viewing the same
page) based on the data that is to appear on the page.. The page displays
data that can be viewed by either (1) all/unauthenticated users, or (2) only
authenticated users. I don't want to implement two pages (one secured
declaratively by Forms authentication and the other not secured) and
associated link issues in order to provide this functionality.

Thanks.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top