Handle OnClick in Jquery or C#
You cannot change the type of the input field on client side in some or all browsers. I would create a custom hiding method in Javascript and leave the input type in text mode (SingleLine), but maybe this has some drawbacks in security.

Other solution is to remove the original input and create a new one on the fly with Javascipt but i think not all browser will let you to read out the value of a password type input.

Third version is to send the field to the server side and get back the new HTML fields but in this way you may send multiple times the password to the server which can be a security hole.