Solved

Bind to Password Textbox

Posted on 2006-10-26
7
1,106 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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