troubleshooting Question

.NET Authentication - Access Denied Redirect

Avatar of webdevelop
webdevelop asked on
.NET ProgrammingASP.NETVisual Basic.NET
6 Comments2 Solutions360 ViewsLast Modified:

I'm trying to get an authenticated web user, who does not have permission to access an area (but is an authenticated user), to receive a redirect to an "Access Denied" page.  Currently they are just a redirected to the login page.

Please provide the complete code for the changes.

<script language="VB" runat="server">
Sub ProcessLogin(objSender As Object, objArgs As EventArgs)
  If FormsAuthentication.Authenticate(txtUser.Text, txtPassword.Text) Then
     FormsAuthentication.RedirectFromLoginPage(txtUser.Text, chkPersistLogin.Checked)
     ErrorMessage.InnerHtml = "<b>Your ID or Password are incorrect.</b> Please try again."
  End If
End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros