Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Preserver password textbox value even after postback

Preserver password textbox value even after postback

Scheduled Pinned Locked Moved ASP.NET
helpquestion
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    meeram395
    wrote on last edited by
    #1

    I have two textoxes in my form as Password and Retype Password. There is a postback after this,. The issue is whenever there is a postback, the two textboxes loses value. Is there anyway I can preserve the value and show the same after postback? please help.

    Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

    B M 2 Replies Last reply
    0
    • M meeram395

      I have two textoxes in my form as Password and Retype Password. There is a postback after this,. The issue is whenever there is a postback, the two textboxes loses value. Is there anyway I can preserve the value and show the same after postback? please help.

      Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      Why are doing postback aftar Retype Password? because I think its not possible when your textbox mode is set to password.

      Cheers!! Brij Check My Latest Article

      M 1 Reply Last reply
      0
      • B Brij

        Why are doing postback aftar Retype Password? because I think its not possible when your textbox mode is set to password.

        Cheers!! Brij Check My Latest Article

        M Offline
        M Offline
        meeram395
        wrote on last edited by
        #3

        It is possible. Probably it would be help somebody. You can use like this: PasswordTextBox.Attributes.Add("value", PasswordTextBox.Text.Trim()); I got this when I googled for some time and got from forums.asp.net This will preserve the value even after postback. But I am not sure whether this will invalidate any other action or causes any issue.

        Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

        B D 2 Replies Last reply
        0
        • M meeram395

          It is possible. Probably it would be help somebody. You can use like this: PasswordTextBox.Attributes.Add("value", PasswordTextBox.Text.Trim()); I got this when I googled for some time and got from forums.asp.net This will preserve the value even after postback. But I am not sure whether this will invalidate any other action or causes any issue.

          Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

          B Offline
          B Offline
          Brij
          wrote on last edited by
          #4

          Thanks for sharing it.Please also share any issue you find. :)

          Cheers!! Brij Check My Latest Article

          1 Reply Last reply
          0
          • M meeram395

            It is possible. Probably it would be help somebody. You can use like this: PasswordTextBox.Attributes.Add("value", PasswordTextBox.Text.Trim()); I got this when I googled for some time and got from forums.asp.net This will preserve the value even after postback. But I am not sure whether this will invalidate any other action or causes any issue.

            Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

            D Offline
            D Offline
            DoctorMick
            wrote on last edited by
            #5

            There is a good reason why the password doesn't get sent back in the postback so I would be wary of setting the value manually. Basically, sending the password back in the postback is a security right, if you right click on your page and view source you can see the password value in plain text, this is obviously not a good thing. If that doesn't bother you, or your organisation, fair enough but personally I wouldn't want my password being sent back in plain text.

            M 1 Reply Last reply
            0
            • D DoctorMick

              There is a good reason why the password doesn't get sent back in the postback so I would be wary of setting the value manually. Basically, sending the password back in the postback is a security right, if you right click on your page and view source you can see the password value in plain text, this is obviously not a good thing. If that doesn't bother you, or your organisation, fair enough but personally I wouldn't want my password being sent back in plain text.

              M Offline
              M Offline
              meeram395
              wrote on last edited by
              #6

              I completely agree with you. This is because I didn't implement the functionality initially. But client requires the same and doesn't want to type again and again since the page have a couple of postbacks.

              Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

              N 1 Reply Last reply
              0
              • M meeram395

                I completely agree with you. This is because I didn't implement the functionality initially. But client requires the same and doesn't want to type again and again since the page have a couple of postbacks.

                Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

                N Offline
                N Offline
                Nishant Singh
                wrote on last edited by
                #7

                Can't u give something Like "remember me " option ??? and store pwd and username in a cookie ??

                1 Reply Last reply
                0
                • M meeram395

                  I have two textoxes in my form as Password and Retype Password. There is a postback after this,. The issue is whenever there is a postback, the two textboxes loses value. Is there anyway I can preserve the value and show the same after postback? please help.

                  Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

                  M Offline
                  M Offline
                  Ma tju
                  wrote on last edited by
                  #8

                  i use UpdatePanel. It work perfectly.

                  ma tju Software Application Engineer Petaling Jaya,Selangor, Malaysia Ring Master SB MVP 2008 ;p Petaling Jaya MOP (Otai)

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups