problems populating htmlinputtext control when type is set to "password"

C

Chris Barrow

Hi everyone,

Does anyone know if there is a problem populating a
system.web.ui.htmlcontrols.htmlinputtext control when the
control's type is set to "password?" I am attempting to
retreive a member's record from a database and populate
the control with the member's password. Unfortunately, if
the control declared on the .aspx side is as follows:

<input type="password" id="txtPassword" runat="server"/>

the control appears to be populated with the value, but
appears blank when the control is displayed in the
browser. The code in .vb code-behind is quite simple:

Protected WithEvents txtPassword as
System.Web.UI.HtmlControls.HtmlInputText

Private Sub Page_Load()
'Get value from db...
'Assign to control
txtPassword.Value = strPassword
End Sub

If I change the control's "type" attribute to "text", the
value is displayed correctly within the control. If anyone
has some insight into the matter, I would greatly
appreciate it.

Thanks,

Chris Barrow
 
S

S. Justin Gengo

Chris,

This is by design.

If a password text box's text were set in code the password would be visible
in the view source. Obviously not secure.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
C

Chris Barrow

S.,

You're right of course. I don't know what frame of mind I
was in when I was working through the problem. Thanks for
your response.

Chris...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top