Click to See Complete Forum and Search --> : Override the asp:ChangePassword for custom use? [ASP.NET 2.0]


Shaitan00
08-09-2008, 06:10 PM
I'm using the <asp:login> control to perform user authentication on my web page, however I am not using the ASP membership stuff, instead I opted to customize the login behavior seeing as I use a Database for authentication purposes


[Default.aspx]
<asp:login id="Login1" OnAuthenticate="OnAuthenticate" runat="server">
...
</asp:login>


[Default.aspx.cs]
// Login Authentication Event //
protected void OnAuthenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated = AuthenticationMethod(Login1.UserName, Login1.Password);

e.Authenticated = Authenticated;
}

Where "AuthenticationMethod" is my custom authentication function that accesses my database and checks to ensure the username/password is valid.


Now I wanted to implement handling to allow the user to change his password, so similarily I decided to use the <asp:ChangePassword> control, however I can't see to find out how to overide the basic functionality which uses ASP membership and instead allow myself to perform the changes to my database instead.
Essentially - I just wanted to use the GUI (html layout) and some of the password validation functionality within <asp:ChangePassword> control so not to have to do it all manually ...

Is there anyway to do this? Or am I going about this the wrong way?
Thanks,

cridley
08-20-2008, 10:15 AM
Look up 'membership provider' on msdn.

A sample class can be found here
http://msdn.microsoft.com/en-us/library/6tc47t75.aspx
and can be adapted for use with your database.

It might actually be easier to write your own control, which is the way I normally do it.

pliant
03-13-2009, 10:17 AM
Did you ever get this to work?