If you want to add text to password mode textfield then you need to write.
txtPassword.Attributes.Add("value", finalString.ToString());
If you want to add text to password mode textfield then you need to write.
txtPassword.Attributes.Add("value", finalString.ToString());