Saturday, March 24, 2012

WatermarkExtender on Password Fields

WatermarkExtender on Password FieldsHi bmiedlar,

TextboxWatermarkExtender works by setting the text/style of the textbox whenever it has no value and changing it when the user enters the textbox. Clearly this wouldn't work with the password field because the watermark text would also be protected. You could modify it though and create aPasswordWatermarkExtender control that toggled between a regular textbox with the watermark text and a password textbox used for entering the value.

Thanks,
Ted

A quick solution to continue using the extender 'as is' with password text box controls:
- Use CSS and watermark an image for password controls.

ie:
Create a separate css class for masked watermarks and include the background:
background-image:url('images/passwordmask.png');

The original css class for the textbox should reset the background image to '';

then in the watermark extender
<atlasctrl:TextBoxWatermarkPropertiesWatermarkText=""WatermarkCssClass="watermarkedMasked"TargetControlID="txtPassword"/>


I sincerely hope that the watermark controls will eventually come with the TextMode property, as it seems such an obvious application of these new Atlas toys...

No comments:

Post a Comment