Changing TextMode to Password results in empty value

J

John Kotuby

Hi all,
I have a simple user-form which accepts contact and profile information for
the user to edit and save. All the textboxes are working fine and displaying
the expected data, both when the screen is first displayed and after a save
of changed data. The text boxes are being populated during the Page_Load
event.

However, when I change the TextMode property to PassWord, as I have 2
password textboxes (one for confirmation) no data shows up in them. Textmode
is the only thing being changed. The HTML source code in the browser does
not even have a value="" property displayed for the input elements with the
type="password".

In fact, for testing, I have set one password field to TextMode="SingleLine"
and the other to "PassWord". In very case the SingeLine textboxes display
the correct data and the PassWord textboxes display nothing. I have swapped
textmodes between the 2 textboxes. I have even done this test on other
textboxes besides the Passwords and the same thing happens.

Note: I have recently installed the IE Developer Toolbar. Might that have
anything to do with the strange behavior?

Does anyone have an idea of what might be happening?
Thanks for any help.
 
D

Dave Bush

This is normal behavior for a textbox in password mode. Otherwise,
you'd have a security issue. (View source, see password).

-----Original Message-----
From: John Kotuby [mailto:[email protected]]
Posted At: Tuesday, October 30, 2007 10:18 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Changing TextMode to Password results in empty value
Subject: Changing TextMode to Password results in empty value

Hi all,
I have a simple user-form which accepts contact and profile information
for
the user to edit and save. All the textboxes are working fine and
displaying
the expected data, both when the screen is first displayed and after a
save
of changed data. The text boxes are being populated during the Page_Load

event.

However, when I change the TextMode property to PassWord, as I have 2
password textboxes (one for confirmation) no data shows up in them.
Textmode
is the only thing being changed. The HTML source code in the browser
does
not even have a value="" property displayed for the input elements with
the
type="password".

In fact, for testing, I have set one password field to
TextMode="SingleLine"
and the other to "PassWord". In very case the SingeLine textboxes
display
the correct data and the PassWord textboxes display nothing. I have
swapped
textmodes between the 2 textboxes. I have even done this test on other
textboxes besides the Passwords and the same thing happens.

Note: I have recently installed the IE Developer Toolbar. Might that
have
anything to do with the strange behavior?

Does anyone have an idea of what might be happening?
Thanks for any help.
 
M

Mark Rae [MVP]

Note: I have recently installed the IE Developer Toolbar. Might that have
anything to do with the [strange] behavior?
No.

Does anyone have an idea of what might be happening?

It's behaving perfectly normally...

You do not pre-populate a Password box, otherwise it would be visible
through a View Source...
 
J

John Kotuby

Thanks guys...

I guess I was confused by the behavior of the native <input
type="password"/> HTML element. It merely masks the characters with dots or
asterisks. Yes, you are correct, it also displays the password in the
on-screen source.
Originally that is what I used when I first created the page.

I later changed the input to an asp:textbox control when I decided to use a
Validation control which required a server control to reference.

I will remove the ability to edit the password from that page... a security
issue for sure. I now realize it is far better to create a stand-alone
"Change Password" screen which requires entering the original password
followed by entering the new password twice (for confirmation).

I'll bet there is even a "change password" Server control template
somewhere...maybe in .NET 3.0?

Mark Rae said:
Note: I have recently installed the IE Developer Toolbar. Might that have
anything to do with the [strange] behavior?
No.

Does anyone have an idea of what might be happening?

It's behaving perfectly normally...

You do not pre-populate a Password box, otherwise it would be visible
through a View Source...
 
D

Dave Bush

" I'll bet there is even a "change password" Server control template
somewhere...maybe in .NET 3.0?"

Um... It's already in 2.0

Dave Bush
http://blog.dmbcllc.com




-----Original Message-----
From: John Kotuby [mailto:[email protected]]
Posted At: Tuesday, October 30, 2007 1:57 PM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Changing TextMode to Password results in empty value
Subject: Re: Changing TextMode to Password results in empty value

Thanks guys...

I guess I was confused by the behavior of the native <input
type="password"/> HTML element. It merely masks the characters with dots
or
asterisks. Yes, you are correct, it also displays the password in the
on-screen source.
Originally that is what I used when I first created the page.

I later changed the input to an asp:textbox control when I decided to
use a
Validation control which required a server control to reference.

I will remove the ability to edit the password from that page... a
security
issue for sure. I now realize it is far better to create a stand-alone
"Change Password" screen which requires entering the original password
followed by entering the new password twice (for confirmation).

I'll bet there is even a "change password" Server control template
somewhere...maybe in .NET 3.0?

Mark Rae said:
Note: I have recently installed the IE Developer Toolbar. Might that have
anything to do with the [strange] behavior?
No.

Does anyone have an idea of what might be happening?

It's behaving perfectly normally...

You do not pre-populate a Password box, otherwise it would be visible
through a View Source...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top