Password textbox - How to fill it?

Discussion in 'ASP .Net Web Controls' started by Luiz Vianna, Oct 22, 2003.

  1. Luiz Vianna

    Luiz Vianna Guest

    Hi folks,

    I have a form.aspx that has an textbox webcontrol named 'password' (and its
    texmode=password).

    I want to fill it with the password value I have on my database.

    The problem is the code

    password.text= "mypass"

    does not work. It works only when I change it to singleline or multline
    textmode.

    How do I do that? Fill the password textbox with the value I have keeping
    the textmode to password....

    Thanks

    Luiz
    Luiz Vianna, Oct 22, 2003
    #1
    1. Advertising

  2. Hi Luiz,

    The TextBox class won't write the value attribute if TextMode is set to
    Password. This is a good thing as sending the password down the wire in
    clear text is really not a good idea. My suggestion is that you explicity
    ask the user for the his/her password instead of filling it yourself. That
    being said if you *really* want to fill the password for yourself you could
    code something like this to force the TextBox to output the input's value,
    ie:
    [C#]
    TextBox1.Attributes.Add("value","YourPassword");

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "Luiz Vianna" <> wrote in message
    news:...
    > Hi folks,
    >
    > I have a form.aspx that has an textbox webcontrol named 'password' (and

    its
    > texmode=password).
    >
    > I want to fill it with the password value I have on my database.
    >
    > The problem is the code
    >
    > password.text= "mypass"
    >
    > does not work. It works only when I change it to singleline or multline
    > textmode.
    >
    > How do I do that? Fill the password textbox with the value I have keeping
    > the textmode to password....
    >
    > Thanks
    >
    > Luiz
    >
    >
    >
    Victor Garcia Aprea [MVP], Oct 23, 2003
    #2
    1. Advertising

  3. Luiz Vianna

    rick Guest

    Luiz,

    Unfortunatly for textbox's with the textmode = password
    that won't work. Here's your way to do it:

    password.attributes.add("value", "PasswordValue")

    -Rick

    >-----Original Message-----
    >Hi folks,
    >
    >I have a form.aspx that has an textbox webcontrol

    named 'password' (and its
    >texmode=password).
    >
    >I want to fill it with the password value I have on my

    database.
    >
    >The problem is the code
    >
    >password.text= "mypass"
    >
    >does not work. It works only when I change it to

    singleline or multline
    >textmode.
    >
    >How do I do that? Fill the password textbox with the

    value I have keeping
    >the textmode to password....
    >
    >Thanks
    >
    >Luiz
    >
    >
    >
    >.
    >
    rick, Nov 17, 2003
    #3
    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. Kathy Burke
    Replies:
    1
    Views:
    1,123
    Severin
    Nov 10, 2003
  2. Islam Elkhayat

    Fill TextBox with DataReader...

    Islam Elkhayat, Nov 22, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    5,335
    Saravana
    Nov 22, 2004
  3. AAaron123
    Replies:
    2
    Views:
    2,153
    AAaron123
    Jan 16, 2009
  4. AAaron123
    Replies:
    1
    Views:
    1,335
    Oriane
    Jan 16, 2009
  5. Dave

    Password Column - fill with dots

    Dave, Dec 2, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    171
Loading...

Share This Page