How to keep the password in a password field when page post back?

Discussion in 'ASP .Net' started by feng, Feb 28, 2004.

  1. feng

    feng Guest

    For a HTTP textbox with a Type of "password", the default
    behaiver is that the field will be cleared out when the
    page is posted back. This make sense in most of the cases.
    But in some situation, it become problematic. In our
    asp.net applicaiton, I would like to keep the password in
    the field, if the page is posted back. Is this possible?
    how?

    Thanks
     
    feng, Feb 28, 2004
    #1
    1. Advertising

  2. feng

    Tyro Guest

    have you tried enableviewstate="true" for the password textbox control?

    "feng" <> wrote in message
    news:0c1c01c3fdb5$edddcd70$...
    > For a HTTP textbox with a Type of "password", the default
    > behaiver is that the field will be cleared out when the
    > page is posted back. This make sense in most of the cases.
    > But in some situation, it become problematic. In our
    > asp.net applicaiton, I would like to keep the password in
    > the field, if the page is posted back. Is this possible?
    > how?
    >
    > Thanks
     
    Tyro, Feb 28, 2004
    #2
    1. Advertising

  3. You could probably use client-side script to copy the field to a hidden
    input control, then on page render, copy it back using Javascript. But why?

    --
    Thanks,

    Eric Lawrence
    Program Manager
    Assistance and Worldwide Services

    This posting is provided "AS IS" with no warranties, and confers no rights.

    "feng" <> wrote in message
    news:0c1c01c3fdb5$edddcd70$...
    > For a HTTP textbox with a Type of "password", the default
    > behaiver is that the field will be cleared out when the
    > page is posted back. This make sense in most of the cases.
    > But in some situation, it become problematic. In our
    > asp.net applicaiton, I would like to keep the password in
    > the field, if the page is posted back. Is this possible?
    > how?
    >
    > Thanks
     
    Eric Lawrence [MSFT], Feb 28, 2004
    #3
  4. depending on implementation you can also use

    if Page.IsPostBack then
    myPasswordField.Text = "..."
    end if


    "feng" <> wrote in message
    news:0c1c01c3fdb5$edddcd70$...
    > For a HTTP textbox with a Type of "password", the default
    > behaiver is that the field will be cleared out when the
    > page is posted back. This make sense in most of the cases.
    > But in some situation, it become problematic. In our
    > asp.net applicaiton, I would like to keep the password in
    > the field, if the page is posted back. Is this possible?
    > how?
    >
    > Thanks
     
    Alexey Smirnov, Feb 28, 2004
    #4
  5. feng

    feng Guest

    Well, I have a login page that has two tabs on it. There
    are different passwrod fields on each tab. I know this
    sounds strange but it is the business requirement of the
    product. When use switch between tabs, a post back is
    required. And that's where my problem comes.

    When user fill out the password field on the first tab and
    switch to the second tab, then if for some reson he wants
    to go back to the first tab, geuss what, the password
    field is cleard and he has to re-fill it again.

    My client found this behaivor is confusing and
    frustrating. They want me to keep the password in the
    field after post back.

    Thank you for your suggestion, but is there any way this
    can be done from the server side? or using features of the
    control itself?

    Thanks


    >-----Original Message-----
    >You could probably use client-side script to copy the

    field to a hidden
    >input control, then on page render, copy it back using

    Javascript. But why?
    >
    >--
    >Thanks,
    >
    >Eric Lawrence
    >Program Manager
    >Assistance and Worldwide Services
    >
    >This posting is provided "AS IS" with no warranties, and

    confers no rights.
    >
    >"feng" <> wrote in

    message
    >news:0c1c01c3fdb5$edddcd70$...
    >> For a HTTP textbox with a Type of "password", the

    default
    >> behaiver is that the field will be cleared out when the
    >> page is posted back. This make sense in most of the

    cases.
    >> But in some situation, it become problematic. In our
    >> asp.net applicaiton, I would like to keep the password

    in
    >> the field, if the page is posted back. Is this possible?
    >> how?
    >>
    >> Thanks

    >
    >
    >.
    >
     
    feng, Feb 28, 2004
    #5
    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. Joby
    Replies:
    0
    Views:
    1,666
  2. =?Utf-8?B?TmFk?=
    Replies:
    6
    Views:
    1,074
    =?Utf-8?B?TmFk?=
    Jun 30, 2005
  3. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    2
    Views:
    5,517
    =?Utf-8?B?ZGF2aWQ=?=
    Mar 31, 2006
  4. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    822
    Masudur
    May 25, 2007
  5. Rick
    Replies:
    3
    Views:
    8,597
    Alexey Smirnov
    Apr 13, 2010
Loading...

Share This Page