Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating Password Text Fields w/ ASP.Net

Status
Not open for further replies.

elhaix

Programmer
Jul 31, 2006
115
CA
Given the following

Code:
<asp:TextBox ID="TxtPassword" runat="server" TextMode="Password" CssClass="input400"></asp:TextBox>

Then in my code behind LoadData() method I set TxtPassword.Text = dbStringValue, when the page loads, this field does not populate.

However, when I remove the TextMode="Password" it works just fine.

How can I get the password field to populate from the code behind?


Thanks.
 
This is a security feature build into .NET.

Try this as a work around:

TxtPassword.Attributes.Add("value", "Some Value");

Just bear in mind that anyone can then view source and see the value of the password field.

HTH

Smeat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top