help me !!!

  • Thread starter Thread starter Alexandre Martins
  • Start date Start date
A

Alexandre Martins

people, i have this code in my web.confi

<location path="admin">
<system.web>
<authorization>
<deny users="*" />
<allow users="administrador" />
</authorization>
</system.web>
</location>


how can i created this user "administrador" in my formsAuthentication ??

I need help....

Tks
 
How about something like this... this would be code in your login click
method...

Dim objFormsAuthentication As System.Web.Security.FormsAuthentication
Dim objSec As New MyClassLibrary.Security()
Dim lngUserId As Long

'--- Using Security component authenticate user
lngUserId = objSec.CheckUser(txtUserName.Value,
txtUserPass.Value, MyClassLibrary.Security.WebUserType.enEmployee,
Application.Item("Connection"))
'--- If user id is positive then login user else set the message
If lngUserId > 0 Then
Session("UserId") = lngUserId
objFormsAuthentication.RedirectFromLoginPage _
(lngUserId, False)
Else
Select Case lngUserId
Case -1, -2
lblMsg.Text = "Invalid Credentials: Please try
again"
Case -3
lblMsg.Text = "Account is locked: Please contact
administrator"
Case -4
lblMsg.Text = "Account is inactive: Please contact
administrator"
End Select

End If



hth
 
Back
Top