Textbox Bug?

Discussion in 'ASP .Net' started by Guest, Feb 20, 2004.

  1. Guest

    Guest Guest

    Weird Bug..
    I am trying to execute this code, essentially a few fields to update a
    custom user login / info form values from DB
    This code works;
    txtUsername.Text = userReader.Item("username")
    txtPassword.Text = userReader.Item("Password")
    However, it displays the password of the user. I want to mask it with the
    password char format. So I add the line of code / or (set the textbox mode
    in properties)
    txtPassword.TextMode = TextBoxMode.Password.
    The text disappears, blank box , no *** chars , nothing visible or
    selectable in the box. However, adding debug code says there is something in
    the box, and it has a len().....??? Invisible, non-selectable text?
    I tried this on several machines with the same results..
    Whats up Microsoft?? Thanks..
    KT
     
    Guest, Feb 20, 2004
    #1
    1. Advertising

  2. Guest

    Teemu Keiski Guest

    Basically the Text is there in Text property, but in TextBox with Password
    mode, it won't render the Value attribute. it will with all other modes.
    That's how it works. Security stuff, I believe.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist


    <kt> wrote in message news:OJVsG4%...
    Weird Bug..
    I am trying to execute this code, essentially a few fields to update a
    custom user login / info form values from DB
    This code works;
    txtUsername.Text = userReader.Item("username")
    txtPassword.Text = userReader.Item("Password")
    However, it displays the password of the user. I want to mask it with the
    password char format. So I add the line of code / or (set the textbox mode
    in properties)
    txtPassword.TextMode = TextBoxMode.Password.
    The text disappears, blank box , no *** chars , nothing visible or
    selectable in the box. However, adding debug code says there is something in
    the box, and it has a len().....??? Invisible, non-selectable text?
    I tried this on several machines with the same results..
    Whats up Microsoft?? Thanks..
    KT
     
    Teemu Keiski, Feb 21, 2004
    #2
    1. Advertising

  3. Your post went unanswered. Have you resolved this issue?

    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
    <kt> wrote in message news:OJVsG4%...
    > Weird Bug..
    > I am trying to execute this code, essentially a few fields to update a
    > custom user login / info form values from DB
    > This code works;
    > txtUsername.Text = userReader.Item("username")
    > txtPassword.Text = userReader.Item("Password")
    > However, it displays the password of the user. I want to mask it with the
    > password char format. So I add the line of code / or (set the textbox mode
    > in properties)
    > txtPassword.TextMode = TextBoxMode.Password.
    > The text disappears, blank box , no *** chars , nothing visible or
    > selectable in the box. However, adding debug code says there is something

    in
    > the box, and it has a len().....??? Invisible, non-selectable text?
    > I tried this on several machines with the same results..
    > Whats up Microsoft?? Thanks..
    > KT
    >
    >
    >
    >
     
    Alvin Bruney [MVP], Mar 2, 2004
    #3
  4. Guest

    sharpeffect

    Joined:
    Sep 25, 2008
    Messages:
    1
    Work around for assigning Text to TextBox while its in Password Mode

    Hi,
    You can do the following to programmatically assign values to TextBox while it is in Password Mode.

    TextBoxPassword.Attributes.Add("value", "blablabla");

    Where TextBoxPassword is the name of that textbox which is in Password Mode. and "blablabla" is the text you are going to assign to it.

    To download the fully functional control and more detail you can visit following link at code project.
    http://www.codeproject.com/KB/webforms/Set_Password_from_code.aspx

    Comments and suggestions are welcomed.
     
    sharpeffect, Sep 25, 2008
    #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. S. Justin Gengo
    Replies:
    0
    Views:
    535
    S. Justin Gengo
    Jul 16, 2003
  2. Hazzard
    Replies:
    2
    Views:
    551
    Yan-Hong Huang[MSFT]
    Jul 23, 2003
  3. Natty Gur
    Replies:
    0
    Views:
    462
    Natty Gur
    Jul 22, 2003
  4. =?Utf-8?B?Q2hyaXM=?=
    Replies:
    3
    Views:
    13,783
    Peter Blum
    Mar 30, 2005
  5. Jay

    Rich TextBox / HTML TextBox

    Jay, Apr 28, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    15,698
    Steve C. Orr [MVP, MCSD]
    Apr 29, 2005
Loading...

Share This Page