Problem with password fields on post back

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon Harvey

    Problem with password fields on post back

    Hi all,

    Can anyone help me with the following:

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

    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]

    #2
    Re: Problem with password fields on post back

    use standard textbox with masking?

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


    "Simon Harvey" <simon.harvey@t he-web-works.co.uk> wrote in message
    news:ebt5PN4MEH A.268@TK2MSFTNG P11.phx.gbl...[color=blue]
    > Hi all,
    >
    > Can anyone help me with the following:
    >
    > I have a page that has a couple of password fields - txtPassword and
    > txtConfirmPassw ord
    >
    > 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
    >
    >[/color]


    Comment

    • Simon Harvey

      #3
      Re: Problem with password fields on post back

      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


      Comment

      • Curt_C [MVP]

        #4
        Re: Problem with password fields on post back

        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" <simon.harvey@t he-web-works.co.uk> wrote in message
        news:OfbPSZ4MEH A.3596@tk2msftn gp13.phx.gbl...[color=blue]
        > 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
        >
        >[/color]


        Comment

        • Simon Harvey

          #5
          Re: Problem with password fields on post back

          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


          Comment

          • Curt_C [MVP]

            #6
            Re: Problem with password fields on post back

            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" <simon.harvey@t he-web-works.co.uk> wrote in message
            news:Og3NAnANEH A.1196@TK2MSFTN GP11.phx.gbl...[color=blue]
            > 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[/color]
            new[color=blue]
            > user. When you click to add a role to the user, the postback occurs.
            >
            > Any thoughts would be great. Thanks for your help
            >
            > Simon
            >
            >[/color]


            Comment

            • Paul Drust

              #7
              Re: Problem with password fields on post back

              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" <simon.harvey@t he-web-works.co.uk> wrote in message news:<Og3NAnANE HA.1196@TK2MSFT NGP11.phx.gbl>. ..[color=blue]
              > 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[/color]

              Comment

              • J Sahoo

                #8
                Re: Problem with password fields on post back

                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" <simon.harvey@t he-web-works.co.uk> wrote in message news:<Og3NAnANE HA.1196@TK2MSFT NGP11.phx.gbl>. ..[color=blue]
                > 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[/color]

                Comment

                Working...