Click here to Skip to main content
12,948,566 members (62,534 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi,
I have a question How to show data in Textbox when its textmode is password....????
Posted 14-Jun-10 1: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
Top Experts
Last 24hrsThis month
OriginalGriff 5,419
CHill60 3,275
Maciej Los 2,778
Jochen Arndt 1,935
ppolymorphe 1,795


Advertise | Privacy | Mobile
Web02 | 2.8.170524.1 | Last Updated 2 Apr 2013
Copyright © CodeProject, 1999-2017
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