how to mask an input

Discussion in 'ASP .Net' started by niv, Dec 29, 2004.

  1. niv

    niv Guest

    Hello,

    I have a textbox that users enter their password into..
    the problem is that i want the password to be masked with
    a asterisk.

    How can I do this and also still be able to read the input
    like so.

    string x;
    x = TextBox1.Text;

    I dont want x to have asterisks..
    Thanks in advance ;)

    niv
    niv, Dec 29, 2004
    #1
    1. Advertising

  2. Hi niv,

    You are going to love this! In your <asp:textbox> tag put this:

    TextMode="Password"

    For example:

    <asp:textbox id="txtPassword" Runat="server"
    TextMode="Password"></asp:textbox>

    Good luck! Ken.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    "niv" <> wrote in message
    news:047001c4ed4d$8b1bdbe0$...
    > Hello,
    >
    > I have a textbox that users enter their password into..
    > the problem is that i want the password to be masked with
    > a asterisk.
    >
    > How can I do this and also still be able to read the input
    > like so.
    >
    > string x;
    > x = TextBox1.Text;
    >
    > I dont want x to have asterisks..
    > Thanks in advance ;)
    >
    > niv
    Ken Dopierala Jr., Dec 29, 2004
    #2
    1. Advertising

  3. Simply change the TextMode property of the TextBox to Password.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "niv" <> wrote in message
    news:047001c4ed4d$8b1bdbe0$...
    > Hello,
    >
    > I have a textbox that users enter their password into..
    > the problem is that i want the password to be masked with
    > a asterisk.
    >
    > How can I do this and also still be able to read the input
    > like so.
    >
    > string x;
    > x = TextBox1.Text;
    >
    > I dont want x to have asterisks..
    > Thanks in advance ;)
    >
    > niv
    Steve C. Orr [MVP, MCSD], Dec 29, 2004
    #3
  4. niv

    niv Guest

    Yess!!!
    I love that.

    Thanks KEN!
    >-----Original Message-----
    >Hi niv,
    >
    >You are going to love this! In your <asp:textbox> tag

    put this:
    >
    >TextMode="Password"
    >
    >For example:
    >
    ><asp:textbox id="txtPassword" Runat="server"
    >TextMode="Password"></asp:textbox>
    >
    >Good luck! Ken.
    >
    >--
    >Ken Dopierala Jr.
    >For great ASP.Net web hosting try:
    >http://www.webhost4life.com/default.asp?refid=Spinlight
    >If you sign up under me and need help, email me.
    >
    >"niv" <> wrote in message
    >news:047001c4ed4d$8b1bdbe0$...
    >> Hello,
    >>
    >> I have a textbox that users enter their password into..
    >> the problem is that i want the password to be masked

    with
    >> a asterisk.
    >>
    >> How can I do this and also still be able to read the

    input
    >> like so.
    >>
    >> string x;
    >> x = TextBox1.Text;
    >>
    >> I dont want x to have asterisks..
    >> Thanks in advance ;)
    >>
    >> niv

    >
    >
    >.
    >
    niv, Dec 29, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Russ

    Input mask on a text box?

    Russ, Dec 29, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    1,809
    Peter Blum
    Dec 30, 2003
  2. Brian Ciarcia

    input mask for textbox

    Brian Ciarcia, Mar 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,758
    Daniel M. Hendricks
    Mar 8, 2005
  3. Franck DARRAS

    [DIV][CSS][TAB] Div mask my input

    Franck DARRAS, Feb 27, 2004, in forum: HTML
    Replies:
    0
    Views:
    640
    Franck DARRAS
    Feb 27, 2004
  4. Marcin Tyman

    Conversion mask in hex to bit mask

    Marcin Tyman, May 6, 2008, in forum: Ruby
    Replies:
    4
    Views:
    809
    Robert Klemme
    May 6, 2008
  5. 187
    Replies:
    2
    Views:
    556
    Bart Lateur
    Jul 29, 2004
Loading...

Share This Page