Click here to Skip to main content
11,411,241 members (66,303 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Hi,
I have a question How to show data in Textbox when its textmode is password....????
Posted 14-Jun-10 2:04am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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

private void button2_Click(object sender, EventArgs e)
       {
           txtNormal.Text = txtPassword.Text;
       }
d
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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();
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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
<asp:textbox id="passwordtext" runat="server" forecolor="White" textmode="Password" />
but u can access it from code easily
lable1.text=passwordtext.text;
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

txtPassword.Attributes["value"] = Convert.ToString(dt.Rows[0]["cPassword"]);
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

txtPassword.Attributes.Add("value","Password")
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 189
1 Maciej Los 108
2 OriginalGriff 88
3 Sascha Lefévre 85
4 BillWoodruff 80
0 Sergey Alexandrovich Kryukov 8,920
1 OriginalGriff 6,918
2 Maciej Los 3,390
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web01 | 2.8.150414.5 | Last Updated 2 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100