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

  • Thread starter Thread starter Chris Barrow
  • Start date Start date
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
 
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
 
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...
 
Back
Top