Ask a Question related to ASP.NET General, Design and Development.
-
Alexandre Martins #1
help me !!!
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
Alexandre Martins Guest
-
alien2_51 #2
Re: help me !!!
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
"Alexandre Martins" <master@alexandrem.com.br> wrote in message
news:e6r66neXDHA.2484@TK2MSFTNGP09.phx.gbl...> 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
>
>
>
>
>
alien2_51 Guest
-
Alexander Davidov [MSFT] #3
RE: help me !!!
Try this page, it seems to have some good sample code:
[url]http://www.xoc.net/works/tips/forms-authentication.asp[/url]
--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
[url]http://www.microsoft.com/info/cpyright.htm[/url]
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
-------------------->From: "Alexandre Martins" <master@alexandrem.com.br>
>Subject: help me !!!
>Date: Fri, 8 Aug 2003 17:17:41 -0300
>Lines: 22
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
>Message-ID: <e6r66neXDHA.2484@TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: 200-168-24-105.speedyterra.com.br 200.168.24.105
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:166276
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
>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
>
>
>
>
>
>
Alexander Davidov [MSFT] Guest



Reply With Quote

