Password Field

Discussion in 'ASP .Net' started by James, Jan 5, 2006.

  1. James

    James Guest

    Have a textbox that's in Password mode on a user creation page. Have
    several dropdowns that cause a PostBack out of necessity on this page. I
    cannot separate them. When one of these dropdowns changes, the textbox's
    value is lost. How do I prevent this?

    Thanks
     
    James, Jan 5, 2006
    #1
    1. Advertising

  2. James

    Bruce Barker Guest

    the best way would be to remember it from the original postback, so it only
    passes over the network once. otherwise you can use a hack, and set the
    control's "value" attribute.

    -- bruce (sqlwork.com)



    "James" <> wrote in message
    news:...
    > Have a textbox that's in Password mode on a user creation page. Have
    > several dropdowns that cause a PostBack out of necessity on this page. I
    > cannot separate them. When one of these dropdowns changes, the textbox's
    > value is lost. How do I prevent this?
    >
    > Thanks
    >
     
    Bruce Barker, Jan 5, 2006
    #2
    1. Advertising

  3. James

    Marina Guest

    You have to do it on the client side using javascript.

    Losing the value of a password field is pretty standard. If the password
    field is the last one on your page, it should in theory be the last field a
    user fills in, so it geting emptied shouldn't really happen.

    "James" <> wrote in message
    news:%...
    > Can I? I've tried setting it in my Page Load event and it doesn't seem to
    > persist. I've also tried using a client side control with runat=server.
    > None of the above seem to want to let me set the value.
    >
    > "Bruce Barker" <> wrote in message
    > news:umI$...
    >> the best way would be to remember it from the original postback, so it
    >> only passes over the network once. otherwise you can use a hack, and set
    >> the control's "value" attribute.
    >>
    >> -- bruce (sqlwork.com)
    >>
    >>
    >>
    >> "James" <> wrote in message
    >> news:...
    >>> Have a textbox that's in Password mode on a user creation page. Have
    >>> several dropdowns that cause a PostBack out of necessity on this page.
    >>> I cannot separate them. When one of these dropdowns changes, the
    >>> textbox's value is lost. How do I prevent this?
    >>>
    >>> Thanks
    >>>

    >>
    >>

    >
    >
     
    Marina, Jan 5, 2006
    #3
  4. James

    James Guest

    Can I? I've tried setting it in my Page Load event and it doesn't seem to
    persist. I've also tried using a client side control with runat=server.
    None of the above seem to want to let me set the value.

    "Bruce Barker" <> wrote in message
    news:umI$...
    > the best way would be to remember it from the original postback, so it
    > only passes over the network once. otherwise you can use a hack, and set
    > the control's "value" attribute.
    >
    > -- bruce (sqlwork.com)
    >
    >
    >
    > "James" <> wrote in message
    > news:...
    >> Have a textbox that's in Password mode on a user creation page. Have
    >> several dropdowns that cause a PostBack out of necessity on this page. I
    >> cannot separate them. When one of these dropdowns changes, the textbox's
    >> value is lost. How do I prevent this?
    >>
    >> Thanks
    >>

    >
    >
     
    James, Jan 5, 2006
    #4
  5. James

    James Guest

    JavaScript doesn't seem to work either. It isn't the last field they will
    enter, and even if it were, there's no way they'd go for that =/.

    "Marina" <> wrote in message
    news:...
    > You have to do it on the client side using javascript.
    >
    > Losing the value of a password field is pretty standard. If the password
    > field is the last one on your page, it should in theory be the last field
    > a user fills in, so it geting emptied shouldn't really happen.
    >
    > "James" <> wrote in message
    > news:%...
    >> Can I? I've tried setting it in my Page Load event and it doesn't seem
    >> to persist. I've also tried using a client side control with
    >> runat=server. None of the above seem to want to let me set the value.
    >>
    >> "Bruce Barker" <> wrote in message
    >> news:umI$...
    >>> the best way would be to remember it from the original postback, so it
    >>> only passes over the network once. otherwise you can use a hack, and set
    >>> the control's "value" attribute.
    >>>
    >>> -- bruce (sqlwork.com)
    >>>
    >>>
    >>>
    >>> "James" <> wrote in message
    >>> news:...
    >>>> Have a textbox that's in Password mode on a user creation page. Have
    >>>> several dropdowns that cause a PostBack out of necessity on this page.
    >>>> I cannot separate them. When one of these dropdowns changes, the
    >>>> textbox's value is lost. How do I prevent this?
    >>>>
    >>>> Thanks
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    James, Jan 5, 2006
    #5
  6. James

    Marina Guest

    I know for a fact that if you set the value on an input control that is a
    password type in javascript, that it does get set correctly. Maybe you need
    to post your code then.

    I bet your users will like the fact that their password is being sent in
    clear text in the browser even less then having to retype their password,
    since that is the only way to preserve it in between posts. I would
    recommend either accepting that passwords will be blank between posts (this
    happens pretty much in every other registration system), re-organize your
    registration in such a way that the password gets its own page and it is the
    last page in the registration process, or code using the javascript solution
    and have the password be sent in clear text - which should be the last
    resort.

    "James" <> wrote in message
    news:...
    > JavaScript doesn't seem to work either. It isn't the last field they will
    > enter, and even if it were, there's no way they'd go for that =/.
    >
    > "Marina" <> wrote in message
    > news:...
    >> You have to do it on the client side using javascript.
    >>
    >> Losing the value of a password field is pretty standard. If the password
    >> field is the last one on your page, it should in theory be the last field
    >> a user fills in, so it geting emptied shouldn't really happen.
    >>
    >> "James" <> wrote in message
    >> news:%...
    >>> Can I? I've tried setting it in my Page Load event and it doesn't seem
    >>> to persist. I've also tried using a client side control with
    >>> runat=server. None of the above seem to want to let me set the value.
    >>>
    >>> "Bruce Barker" <> wrote in message
    >>> news:umI$...
    >>>> the best way would be to remember it from the original postback, so it
    >>>> only passes over the network once. otherwise you can use a hack, and
    >>>> set the control's "value" attribute.
    >>>>
    >>>> -- bruce (sqlwork.com)
    >>>>
    >>>>
    >>>>
    >>>> "James" <> wrote in message
    >>>> news:...
    >>>>> Have a textbox that's in Password mode on a user creation page. Have
    >>>>> several dropdowns that cause a PostBack out of necessity on this page.
    >>>>> I cannot separate them. When one of these dropdowns changes, the
    >>>>> textbox's value is lost. How do I prevent this?
    >>>>>
    >>>>> Thanks
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Marina, Jan 5, 2006
    #6
  7. James

    James Guest

    Thanks for the help, this seems to work on Postback:

    tbPassword.Attributes("value") = tbPassword.Text

    "Marina" <> wrote in message
    news:...
    >I know for a fact that if you set the value on an input control that is a
    >password type in javascript, that it does get set correctly. Maybe you
    >need to post your code then.
    >
    > I bet your users will like the fact that their password is being sent in
    > clear text in the browser even less then having to retype their password,
    > since that is the only way to preserve it in between posts. I would
    > recommend either accepting that passwords will be blank between posts
    > (this happens pretty much in every other registration system), re-organize
    > your registration in such a way that the password gets its own page and it
    > is the last page in the registration process, or code using the javascript
    > solution and have the password be sent in clear text - which should be the
    > last resort.
    >
    > "James" <> wrote in message
    > news:...
    >> JavaScript doesn't seem to work either. It isn't the last field they
    >> will enter, and even if it were, there's no way they'd go for that =/.
    >>
    >> "Marina" <> wrote in message
    >> news:...
    >>> You have to do it on the client side using javascript.
    >>>
    >>> Losing the value of a password field is pretty standard. If the
    >>> password field is the last one on your page, it should in theory be the
    >>> last field a user fills in, so it geting emptied shouldn't really
    >>> happen.
    >>>
    >>> "James" <> wrote in message
    >>> news:%...
    >>>> Can I? I've tried setting it in my Page Load event and it doesn't seem
    >>>> to persist. I've also tried using a client side control with
    >>>> runat=server. None of the above seem to want to let me set the value.
    >>>>
    >>>> "Bruce Barker" <> wrote in message
    >>>> news:umI$...
    >>>>> the best way would be to remember it from the original postback, so it
    >>>>> only passes over the network once. otherwise you can use a hack, and
    >>>>> set the control's "value" attribute.
    >>>>>
    >>>>> -- bruce (sqlwork.com)
    >>>>>
    >>>>>
    >>>>>
    >>>>> "James" <> wrote in message
    >>>>> news:...
    >>>>>> Have a textbox that's in Password mode on a user creation page. Have
    >>>>>> several dropdowns that cause a PostBack out of necessity on this
    >>>>>> page. I cannot separate them. When one of these dropdowns changes,
    >>>>>> the textbox's value is lost. How do I prevent this?
    >>>>>>
    >>>>>> Thanks
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    James, Jan 5, 2006
    #7
    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.

Share This Page