Solved

Bind to Password Textbox

Posted on 2006-10-26
7
1,108 Views
Last Modified: 2008-02-01
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?
0
Comment
Question by:strickdd
  • 3
  • 2
7 Comments
 
LVL 11

Expert Comment

by:TornadoV
ID: 17812455
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
 
LVL 28

Author Comment

by:strickdd
ID: 17812492
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
 
LVL 11

Expert Comment

by:TornadoV
ID: 17812534
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 28

Author Comment

by:strickdd
ID: 17812562
I wasn't able to find the control or the value in the control when i viewed the source
0
 
LVL 11

Expert Comment

by:TornadoV
ID: 17812594
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
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 17929893
PAQd, 500 points refunded.

DarthMod
CS Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question