Author: cool2000 | Posted on: 1/2/2009 5:27:04 AM | Views : 272

I have the impression that Forms Authentication absolutely either allows or denies access to pages [in a designated folder] when a user is not authenticated. I mean, if you do not log in, you absolutely cannot see the page because it will keep redirecting you to that login.aspx page, as you have set in web.config.
For example, I have a default.aspx page on the root directory. I want everybody to be able to see it, even when they're not logged in. When they are not logged in, I want to show a login.ascx user control. When they log in, I want them to be able to see this very same page, however, without the login.ascx control, and now, showing some input controls so they can enter data and a toolbar that displays their user name and the link to log out.

What do I need to do in the web.config file? Can I say "forms loginUrl="default.aspx" defaultUrl="default.aspx"? For every page load, how do I check whether a user is authenticated or not?< ...

Go to the complete details ...