Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a question How to show data in Textbox when its textmode is password....????
Posted

Can you please explain your requirement. I don't understand what you are trying to do.
When textmode for a TextBox is set to password, it will show text like **** because that's how it is designed. Password is a secure data which should not be visible to everyone so it is shown like that.
If you do not want it that way, use textmode = SingleLine.

If this doesn't help, explain the requirement.
 
Share this answer
 
C++
txtPassword.Attributes["value"] = Convert.ToString(dt.Rows[0]["cPassword"]);
 
Share this answer
 
Comments
Member 13519055 13-Nov-17 13:42pm    
Thanks a lot,it worked for me.
Let say there is 2 txt box. One having password char = * and other one is normal txt box, plus one button to display the actual character typed in txtpassword once press

see below

C#
private void button2_Click(object sender, EventArgs e)
       {
           txtNormal.Text = txtPassword.Text;
       }

d
 
Share this answer
 
Hi ALL!
i got answer of this question. system.web.ui.textbox has attributes property that we can pass value to it.
sample code is as:

txtPassword.attributes["value"] = txtabc.text.trim();
 
Share this answer
 
as mentioned before password is secured
so, you want user writes it but others who stand near him/her can't see the password written .
And you can also [for more security ]make textbox forecolor property like page for color that makes password you are writing can't be seen
XML
<asp:textbox id="passwordtext" runat="server" forecolor="White" textmode="Password" />

but u can access it from code easily
C#
lable1.text=passwordtext.text;
 
Share this answer
 
v3
txtPassword.Attributes.Add("value","Password")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900