views:

955

answers:

2

Hi, I am doing "forgotpassword functionality" in asp.net

My forgotpassword.aspx page consists of a username, security question, security answer, new password,retype password and a submit button.

When I click on the "forgotpassword" link at the previous page, it should prompt me about the security question and when I enter the answer at the security answer textbox, the control should take those two (security quesion and security answer) to the backend (database) and validate that the security answer is correct. It should reply with a boolean value. Then the next 'new password' and 'retype password' should get activated.

By means the operation of going back to database should occur when the control comes out of the security answer textbox. In windows forms we can use the 'leave' event (ex:textbox1_leave) but in web forms we don't have that.

If the solution is to use javascript, please give me the step by step process to handle the aspx (source page) and also the .cs file coding

+1  A: 

hi you could use microsofts membershipprovider interfaces. you just have to implement it for your own requirements (database structure).

just have a look at http://www.asp.net/learn/security-videos/ there you can watch a lot of helpful videos for understanding and implementing membership and role providers.

it helped me also to implement my first membershipprovider.

this link might be also usefull http://weblogs.asp.net/scottgu/archive/2006/05/07/ASP.NET-2.0-Membership-and-Roles-Tutorial-Series.aspx

as soon as you have finished, you can use all microsoft login controls.

good luck

nWorx
This is definitely a great solution, though if his solution is currently not using the membership provider interfaces, it's a big hassle to add. Of course, implementing your own login system is a horrible idea unless you really know what you're doing (and is begging for broken security, too), so it's probably worth a rewrite anyhow if he is using a homegrown solution.
Brian
A: 

There is a forgot password component in ASP.NET 2.0 - just use that and configure it.

ck