Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > keep password if validation fails View modes: 
User avatar
Member
Member
eagleag - 7/24/2012 3:37:58 AM
   
keep password if validation fails
I saw this thread http://devnet.kentico.com/Forums/f36/fp5/t19444/keep-password-if-validation-fails.aspx but I didn't understand how to make it work.

Can someone break it done?
What needs to be done?
Code examples would be much appreciated :)

Thanks


User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/26/2012 2:44:04 AM
   
RE:keep password if validation fails
Hi,

That thread is a bit outdated and there is a much simpler approach. I've checked some forums and this is a general .NET issue/behavior pattern. If you set the textbox TextMode to Password, it will automatically discard your value. You need to either change the TextMode to e.g. SingleLine, or you can add the following line of code to the Page_Load method in the file ~\CMSModules\Membership\FormControls\Passwords\Password.ascx.cs:

txtPassword.Attributes["value"] = txtPassword.Text;

This modification was tested with the Password form control.

Best regards,
Boris Pocatko