How to use membership provider with login control
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
I have created a custom Membership Provider, and set it as default
membership provider in web.config.
I have also set deny users ="?" in web.config.
When I use a login control with it, it work fine. but now I want to valid
with code like:
MyMembershipProvider myProvider = new MyMembershipProvider();
if (myProvider.ValidateUser("myid", "mypw"))
{
Response.Redirect("~/Home.aspx");
}
The ValidateUser return true, but it can't redierct to home.aspx.
I find the page.user.identity.name is none after ValidateUser, but if I use
login controls, the Page.User.Identity will set to the login id after valid.
How can I use Membership Provider without login control?
.
Relevant Pages
- Re: SQLException after submitting form in ASP.Net 2.0
... You have to execute InstallCommon.sql too ... I developed a form using Login Control in ASP.Net 2.0. ... used Membership provider. ... (microsoft.public.dotnet.framework.aspnet) - Login default provider
... 'couldnt connect to SqlServer Express....'. ... Unless you specify otherwise, the Login control uses the default ... I dont have a membership provider in my web config, ... (microsoft.public.dotnet.framework.aspnet) - asp.net login contol using url redirect
... I have an asp.net website that uses the login control and a custom build ... membership provider. ... I could of course put the code on the site that uses the frame, ... (microsoft.public.dotnet.framework.aspnet.security) - Re: web.config credentials section - original reply
... default membership provider ... membership APIs don't check the credentials stored in web.config. ... You are free to write a custom membership provider that can validate user ... Or you can write a custom Login control that can do this. ... (microsoft.public.dotnet.framework.aspnet) - Re: Membership custom provider - logout function
... ValidateUser is not a login operation - it validates credentials - and retrurns a boolean according to the outcome of the validation. ... I have derived from the Membership provider and have supplied my own method that work against my security server. ... (microsoft.public.dotnet.framework.aspnet.security) |
|