setting a default password in a textbox

  • Thread starter Thread starter corey s.
  • Start date Start date
C

corey s.

My system allows a user to change their email address and password.
When the user goes to the "Update Profile" page the email address can
be populated but the Password/ConfirmPassword fields can not be
popluated.

I understand the secuirty concerns for .NET not allowing to preload a
value in the text box. Is there a way of using a standard textbox
control and managing the characters when a user types (like adding
stars instead of the characters the user inputs)?
 
Corey:
You can probably do something in Javascript, such as catch the OnKeyDown
event, get the actual key pressed, store it in a hidden field, cancel the
default behaviour of the event (placing the key in the textbox) and putting
a * instead.

You do know that:
<asp:TextBox id="pwd" Runat="server" TextMode="Password" value="xx" />

works, right?

Karl
 
Karl, thanks for the reply. I actually found what i needed with the
line of code below:

MyPWTextBox.Attributes.Add("value", strPassword)
 
Back
Top