Problem with password fields on post back

Discussion in 'ASP .Net' started by Simon Harvey, May 6, 2004.

  1. Simon Harvey

    Simon Harvey Guest

    Hi all,

    Can anyone help me with the following:

    I have a page that has a couple of password fields - txtPassword and
    txtConfirmPassword

    I also have a need on this page to do postbacks and then reload the page.
    The problem is that when the page reloads, the password fields are empty.
    They havent been reinitialised using the viewstate.

    I realise this is a useful security precaution, but is there anyway I can
    either turn this functionality off or circumvent it as it isnt appropriate
    on this particular page?

    Thanks all

    Simon
    Simon Harvey, May 6, 2004
    #1
    1. Advertising

  2. Simon Harvey

    Curt_C [MVP] Guest

    use standard textbox with masking?

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Simon Harvey" <> wrote in message
    news:...
    > Hi all,
    >
    > Can anyone help me with the following:
    >
    > I have a page that has a couple of password fields - txtPassword and
    > txtConfirmPassword
    >
    > I also have a need on this page to do postbacks and then reload the page.
    > The problem is that when the page reloads, the password fields are empty.
    > They havent been reinitialised using the viewstate.
    >
    > I realise this is a useful security precaution, but is there anyway I can
    > either turn this functionality off or circumvent it as it isnt appropriate
    > on this particular page?
    >
    > Thanks all
    >
    > Simon
    >
    >
    Curt_C [MVP], May 6, 2004
    #2
    1. Advertising

  3. Simon Harvey

    Simon Harvey Guest

    Thats an interesting idea Curt.

    I didnt think that the standard textbox had support for masking.

    Does it just work that you can get the text out of the text box as normal,
    but the text is obscured somehow?

    Thanks for your help!

    Simon
    Simon Harvey, May 6, 2004
    #3
  4. Simon Harvey

    Curt_C [MVP] Guest

    use two textboxes perhaps? This would be a lot of clientside but have the
    keystroke write the current value to a hidden textbox and replace the
    visible one with ***.
    Never tried this but it may work.

    How about explaining WHY you need to have it postback AND keep the password
    visible. Maybe there is a better way to accomplish what you are after.

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Simon Harvey" <> wrote in message
    news:...
    > Thats an interesting idea Curt.
    >
    > I didnt think that the standard textbox had support for masking.
    >
    > Does it just work that you can get the text out of the text box as normal,
    > but the text is obscured somehow?
    >
    > Thanks for your help!
    >
    > Simon
    >
    >
    Curt_C [MVP], May 6, 2004
    #4
  5. Simon Harvey

    Simon Harvey Guest

    The reason why I have to do this is that I have a form that allows the
    system admin of a website to create a new user for the site.

    He needs to put in various details including an initial password for the
    user. The user changes this at first login.

    Also on the page are two list boxes, the first containing all available
    roles, and the other containing any roles that you want to assign to the new
    user. When you click to add a role to the user, the postback occurs.

    Any thoughts would be great. Thanks for your help

    Simon
    Simon Harvey, May 7, 2004
    #5
  6. Simon Harvey

    Curt_C [MVP] Guest

    after he postsback if the pass is saved why display it again? If there is a
    problem saving it's pretty common to have to reenter the pass, just leave it
    at that.

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Simon Harvey" <> wrote in message
    news:...
    > The reason why I have to do this is that I have a form that allows the
    > system admin of a website to create a new user for the site.
    >
    > He needs to put in various details including an initial password for the
    > user. The user changes this at first login.
    >
    > Also on the page are two list boxes, the first containing all available
    > roles, and the other containing any roles that you want to assign to the

    new
    > user. When you click to add a role to the user, the postback occurs.
    >
    > Any thoughts would be great. Thanks for your help
    >
    > Simon
    >
    >
    Curt_C [MVP], May 7, 2004
    #6
  7. Simon Harvey

    Paul Drust Guest

    Simon,

    You may not want to put your passwords into a hidden text field simply
    because it is in plain text if someone does "View Source" on the page
    (perhaps not an issue).

    Might I suggest a few other possibilities:
    (1) Rearchitect the "roles" handling so it doesn't require a postback
    (don't know what you code is doing, so I can't tell if this is
    feasible).
    (2) Make the password change and the "roles" handling separate
    processes on two different pages.
    (3) Make the user save the password changes before performing the
    "roles" processing. After the postback, the password fields would be
    blank, but they would already be saved. Not the nicest UI
    implementation, but there it is.

    Good luck.

    -- Paul



    "Simon Harvey" <> wrote in message news:<>...
    > The reason why I have to do this is that I have a form that allows the
    > system admin of a website to create a new user for the site.
    >
    > He needs to put in various details including an initial password for the
    > user. The user changes this at first login.
    >
    > Also on the page are two list boxes, the first containing all available
    > roles, and the other containing any roles that you want to assign to the new
    > user. When you click to add a role to the user, the postback occurs.
    >
    > Any thoughts would be great. Thanks for your help
    >
    > Simon
    Paul Drust, May 7, 2004
    #7
  8. Simon Harvey

    J Sahoo Guest

    I have the same problem but so far I have not got any real solution as
    how to handle it. If anybody can provide some sample code, it will be
    a great help. May be somebody from Microsoft should provide some help.

    Thank you.

    Sahoo J


    "Simon Harvey" <> wrote in message news:<>...
    > The reason why I have to do this is that I have a form that allows the
    > system admin of a website to create a new user for the site.
    >
    > He needs to put in various details including an initial password for the
    > user. The user changes this at first login.
    >
    > Also on the page are two list boxes, the first containing all available
    > roles, and the other containing any roles that you want to assign to the new
    > user. When you click to add a role to the user, the postback occurs.
    >
    > Any thoughts would be great. Thanks for your help
    >
    > Simon
    J Sahoo, May 7, 2004
    #8
    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. feng
    Replies:
    4
    Views:
    1,290
  2. Joby
    Replies:
    0
    Views:
    1,617
  3. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    756
    Masudur
    May 25, 2007
  4. AAaron123
    Replies:
    2
    Views:
    2,106
    AAaron123
    Jan 16, 2009
  5. AAaron123
    Replies:
    1
    Views:
    1,321
    Oriane
    Jan 16, 2009
Loading...

Share This Page