password field can't be preloaded

Discussion in 'ASP .Net' started by Homa, Oct 21, 2003.

  1. Homa

    Homa Guest

    Hi,

    I have a quick question.

    I have a webpage allow user to modify his/her information. When I
    generate the form, I want to pre-load the information to the
    TextBoxes. But for the password (and confirm password) textbox, the
    text can't be loaded (the TextBoxes are empty, no "dot" in them). I
    checked inside Page_Load the text is loaded, but when the page is
    render, the data is flushed.

    I read some ASP code that in ASP this won't happen, you just do:

    <input type="password" name="vcPassword" value="<%=vcPassword%>">


    Please Help

    Homa Wong
    Homa, Oct 21, 2003
    #1
    1. Advertising

  2. You're not supposed to set the text of a password field from the server
    because it's unsecure. That's why it didn't show up; it's prevented as a
    security precaution. (The password would be plain text to anybody who views
    the source of the page.)

    However there is a workaround if you are willing to accept this risk.
    Here's the simplest example I've seen:

    MyPWTextBox.Attributes.Add("value", strPassWord)

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com



    "Homa" <> wrote in message
    news:...
    > Hi,
    >
    > I have a quick question.
    >
    > I have a webpage allow user to modify his/her information. When I
    > generate the form, I want to pre-load the information to the
    > TextBoxes. But for the password (and confirm password) textbox, the
    > text can't be loaded (the TextBoxes are empty, no "dot" in them). I
    > checked inside Page_Load the text is loaded, but when the page is
    > render, the data is flushed.
    >
    > I read some ASP code that in ASP this won't happen, you just do:
    >
    > <input type="password" name="vcPassword" value="<%=vcPassword%>">
    >
    >
    > Please Help
    >
    > Homa Wong
    Steve C. Orr [MVP, MCSD], Oct 21, 2003
    #2
    1. Advertising

  3. Homa

    Jerry III Guest

    It's a security issue. If you want your applications to be secure you should
    only store hashed password values so you will never be able to know the
    original password. And in any case you should not be sending passwords to
    anybody, not even the original user.

    Jerry

    "Homa" <> wrote in message
    news:...
    > Hi,
    >
    > I have a quick question.
    >
    > I have a webpage allow user to modify his/her information. When I
    > generate the form, I want to pre-load the information to the
    > TextBoxes. But for the password (and confirm password) textbox, the
    > text can't be loaded (the TextBoxes are empty, no "dot" in them). I
    > checked inside Page_Load the text is loaded, but when the page is
    > render, the data is flushed.
    >
    > I read some ASP code that in ASP this won't happen, you just do:
    >
    > <input type="password" name="vcPassword" value="<%=vcPassword%>">
    >
    >
    > Please Help
    >
    > Homa Wong
    Jerry III, Oct 21, 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. AAaron123
    Replies:
    2
    Views:
    2,092
    AAaron123
    Jan 16, 2009
  2. AAaron123
    Replies:
    1
    Views:
    1,313
    Oriane
    Jan 16, 2009
  3. Replies:
    62
    Views:
    695
    Thomas 'PointedEars' Lahn
    May 26, 2006
  4. Replies:
    1
    Views:
    80
    Randy Webb
    Nov 25, 2006
  5. Replies:
    3
    Views:
    137
Loading...

Share This Page