A1VBCode Forums

Login Access Web Page using ASP.NET (VB)


http://www.a1vbcode.com/vbforums/Topic31001.aspx

By Carol_Lai - 12/8/2011

Hi,

I need to create a login access form using ASP.NET. The code i'm using is VB.NET. This access form has to link to my SQL Server database. I need to validate the username and password from the database and also the access right to either admin or user.

If username and password valid then
     If access right = "admin" then
     Response.Redirect ("admin.aspx")
     Else
     Response.Redirect ("user.aspx")
     End If
End If

How should i go about writing the code? The username input in the loginpage is also required for me to track the full name in my database and display it on the other webpage. Can anyone help me? Thank you very much

By annaharris - 5/30/2013

Your code for validating user and admin for login rights looks fine to me. You can definitely use this code.