In my web application , am using Membership Provider
In this ,i want to validate Login manually,,,Manual validation that i wrote is below and it is working,,
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Dim bauthenticated As [Boolean] = False
' Dim cls As MembershipProviders = CType(Membership.Providers("MembershipProviders"), MembershipProviders)
bauthenticated = Membership.ValidateUser(Login1.UserName, Login1.Password)
If bauthenticated Then
e.Authenticated = True
Else
e.Authenticated = False
End If
End Sub
But,,,while login,,manual(above) and automatic validations are taking place(2 times validating),,,
when debuging,,First it validating directly from Membership provider class,,then it validate again from Login1_Authenticate(above) event.
I want to prevent automatic validation,,,how to possible this,,,,,
Actually am using memmbersip provider and role provider,, and using other controls(like CreateUser,ChangePassword etc)
So i want to use Login Control for Login and want to validate manually,,,,
I don't understand the problem? When using the providers, you can choose whether to use the login controls, which will automatically call the methods in the providers, or you don't use the controls, and call the methods manually.
If you want to call the authenticate method in code, simply use 2 textboxes and a button. But can you explain the reason why you want to do it manually?
Why would you want to validate the user, because the Login control already did that, and the result was True, otherwise the user wouldn't be logged in....
shahas_sss
Member
176 Points
183 Posts
Login Control
Apr 18, 2012 12:29 PM|LINK
Hi,
In my web application , am using Membership Provider
In this ,i want to validate Login manually,,,Manual validation that i wrote is below and it is working,,
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Dim bauthenticated As [Boolean] = False
' Dim cls As MembershipProviders = CType(Membership.Providers("MembershipProviders"), MembershipProviders)
bauthenticated = Membership.ValidateUser(Login1.UserName, Login1.Password)
If bauthenticated Then
e.Authenticated = True
Else
e.Authenticated = False
End If
End Sub
But,,,while login,,manual(above) and automatic validations are taking place(2 times validating),,,
when debuging,,First it validating directly from Membership provider class,,then it validate again from Login1_Authenticate(above) event.
I want to prevent automatic validation,,,how to possible this,,,,,
pls help,,,
kimkosta06
Member
270 Points
50 Posts
Re: Login Control
Apr 18, 2012 12:36 PM|LINK
this will do your automatic authantication.
hans_v
All-Star
35986 Points
6550 Posts
Re: Login Control
Apr 18, 2012 12:42 PM|LINK
WHY???
If you want to do it manually, simply don't use the login control!
shahas_sss
Member
176 Points
183 Posts
Re: Login Control
Apr 18, 2012 01:16 PM|LINK
hi,,thank u for reply,,
Actually am using memmbersip provider and role provider,, and using other controls(like CreateUser,ChangePassword etc)
So i want to use Login Control for Login and want to validate manually,,,,
If u have solution pls reply,,,
hans_v
All-Star
35986 Points
6550 Posts
Re: Login Control
Apr 18, 2012 01:52 PM|LINK
I don't understand the problem? When using the providers, you can choose whether to use the login controls, which will automatically call the methods in the providers, or you don't use the controls, and call the methods manually.
If you want to call the authenticate method in code, simply use 2 textboxes and a button. But can you explain the reason why you want to do it manually?
jamshed alam
Member
319 Points
105 Posts
Re: Login Control
Apr 18, 2012 01:56 PM|LINK
use
protected void Login1_LoggedIn(object sender, EventArgs e)
{
Membership.ValidateUser(Login1.UserName,Login1.Password);
}
hans_v
All-Star
35986 Points
6550 Posts
Re: Login Control
Apr 18, 2012 02:15 PM|LINK
Why would you want to validate the user, because the Login control already did that, and the result was True, otherwise the user wouldn't be logged in....