Password dilema

A

Anita C

Hi,
I have a webform, with 2 textboxes(set to singleline mode) and a submit
button. The text in the textboxes is populated on pageload on a function
call which retrieve the text as an e.g as follows from an xml
document:protected void RetrievePassword(TextBox txtPassword, int nodeIndex)
//retrieve value to txtPassword
XmlNodeList passwordNodeList =
xmlDocument.SelectNodes("/SERVERS/SERVER/@PASSWORD");
XmlNode password = passwordNodeList.Item(nodeIndex);
txtPassword.Text = password.Value.ToString();

If updated and the submit button is clicked the foll. code is executed to
update the password in the xml document: XmlNodeList passwordNodeList =
xmlDocument.SelectNodes("/SERVERS/SERVER/@PASSWORD");
XmlNode password = passwordNodeList.Item(nodeIndex);
password.Value = txtPassword.Text;

The problem with the above is that the password appears in clear text. Is
there a way of displaying the text typed into txtPassword as "****" when the
value is read as say "abc" ? How can the 'value of the textbox be set and
inside which function?
What property of the txtPassword should I set to achieve the above.
What code should I change in the above 2 functions so that instead of the
text of txtPassword it's 'value' is used to retrieve and update?
I don't want to set the textmode to Password as I want the password to be
remembered enough to be updated in the xml doc. and also when retrieved
would like to see a visual indication such as*** instead of a blank textbox.
Any help will be greatly appreciated.
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top