"jobs" <jo**@webdos.comwrote in message
news:11**********************@c77g2000hse.googlegr oups.com...
Hello.
If my users are logged in, and try to access restricted pages I want
to direct them to a custom 403 page. If they are not logged in, I
would like to continue to direct them to the login page as is
currently happening.
Curently, they always direct to the Login page in both cases, which i
think is confusing.
I have this in the web.config of the directory and the project
webconfig:
<customErrors defaultRedirect="~/ErrorPage.htm">
<error statusCode="403" redirect="~/NoAccess.htm"/>
<error statusCode="404" redirect="~/FileNotFound.htm"/>
</customErrors>
Thanks for any help or information!
As Peter said, there are many ways.
In my application, I keep the username from the login-form in a session var.
Next, on any form load, I check the username for access rights. If not
granted, the user is redirected to the login form.
This gives me even more options: On some forms I can give readonly right to
certain users, while other users can update the database. In my case I have
a user login table on a SQL server with more than granted access/not granted
access; I have about 10 properties for each user so I can set a lot of
individual settings in each form. It is very flexible and very functional.
Bjorn