Bind to Password Textbox

I have a formview that I want a user to be able to update a password with. I want to bind the oringinal password to a textbox with the textmode set to password, but when I try this is doesn't bind. I have the textbox control below:

<asp:TextBox ID="PasswordTextBox" runat="server" Text='<%# Bind("Password") %>' TextMode="password" ReadOnly="true" />

Any ideas?
LVL 28
strickddAsked:
Who is Participating?
 
DarthModConnect With a Mentor Commented:
PAQd, 500 points refunded.

DarthMod
CS Moderator
0
 
TornadoVCommented:
For security reason, TextBox with TextMode="Password" setting cannot be assigned or populated via the Text property on Page_Load or PostBack event.

Also, TextMode = "Password" can only be set @ design time.

You have a couple fo options if you're using AspNetSqlMembershipProvider.  Perhaps you can utilize password retrieve/reset options: http://www.qualitydata.com/products/aspnet-membership/help/configuration/asp-net-sql-membership-password-administration.aspx

Here are couple of other links:
http://forums.asp.net/thread/1412114.aspx
http://www.odetocode.com/Articles/427.aspx

Hope this helps.
0
 
strickddAuthor Commented:
I found a work around because I am NOT using ASP.Net security. What I ended up doing is binding to a textbox that I set the Visible property to false. It is not rendered clientside and the text cannot be viewed by the client, but it maintains the e.OldValues[] when Updating.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
TornadoVCommented:
Good, keep in mind that hidden text box with password is still visible in the 'View Source'.  I would at least use some kind of encryption.
0
 
strickddAuthor Commented:
I wasn't able to find the control or the value in the control when i viewed the source
0
 
TornadoVCommented:
you're right, I got it confused with display:none, with Visible = false server side control is not rendered.  My bad, it's too early for me.:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.