Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Password Field

Reply
Thread Tools

Password Field

 
 
James
Guest
Posts: n/a
 
      01-05-2006
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


 
Reply With Quote
 
 
 
 
Bruce Barker
Guest
Posts: n/a
 
      01-05-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      01-05-2006
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:umI$(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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
>>>

>>
>>

>
>



 
Reply With Quote
 
James
Guest
Posts: n/a
 
      01-05-2006
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" <(E-Mail Removed)> wrote in message
news:umI$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>

>
>



 
Reply With Quote
 
James
Guest
Posts: n/a
 
      01-05-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:umI$(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Marina
Guest
Posts: n/a
 
      01-05-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:umI$(E-Mail Removed)...
>>>> 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" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> 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
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
James
Guest
Posts: n/a
 
      01-05-2006
Thanks for the help, this seems to work on Postback:

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

"Marina" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>> 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" <(E-Mail Removed)> wrote in message
>>>> news:umI$(E-Mail Removed)...
>>>>> 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" <(E-Mail Removed)> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
Change a users password without knowing the old password nor the answer to the password question AAaron123 ASP .Net 1 01-16-2009 02:56 PM
Changing a users password without knowing the old password nor the answer to the password question AAaron123 ASP .Net 2 01-16-2009 02:08 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
How to keep the password in a password field when page post back? feng ASP .Net 4 02-28-2004 06:46 PM



Advertisments