textbox and password type input

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hello!

just would like to know. when i set an ASP textbox control to be of input
type password, i can't do a "txtPassword.Text = "value"". when the page
renders the control just appears empty. why would that be? is this by
design? how would i get passed this, cause i do need to populate that box
with a value?

Thanks
Jason
 
It is by design, for security reasons - so that the password is not in the
HTML in plain text.

Now, you could write out javascript to set the value property of the textbox
on the client, of course this would still mean that you have the password in
plain text in the HTML.
 
its by design. to set the value, use attributes.

txtPassword.Attributes["value"]="password";

-- bruce (sqlwork.com)
 
Back
Top