A: 

This is a bad idea. You should not be showing users passwords on screen. Ideally, your application should not be able to retrieve passwords, only check a hashed password against a persisted salted hash.

RedFilter
which is in user name text box, it should display text[username], and Password text i have to display [ password]. when user enter password text box it should be display[******].
vasanth
A: 

Give this a shot... if you REALLY want to change the field type, which I don't suggest.

Source code examples provided.

http://forums.asp.net/p/1200466/2124486.aspx#2124486

Brad
+2  A: 

Try this.

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
  <html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head profile="http://gmpg.org/xfn/11"&gt;
  <script type="text/javascript">
  function ChangeToPassField() {
    document.getElementById('MyPasswordField').type="password";
  }
  </script>
  </head>
  <body>
  <input type="text" value="password" id="MyPasswordField" onfocus="ChangeToPassField()" />
  </body>
  </html>
GeekTantra
Thanks, But I need user name text box, it should display text[username], and Password text i have to display [ password]. when user enter password text box it should be display[******].
vasanth
I thinks this does what you wanted, maybe if you add code to remove the text (`document.getElementById('MyPasswordField').value = "";`)
Martinho Fernandes