473,396 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with Password TextMode

I have a simple data access and administration page for
user details on my site, including a login password --
but I cannot get the textbox to work properly if the
TextMode is set to "Password".

The user details are modified in making a hidden table
with textboxes visible -- in response an edit command
from the datagrid. One of the textboxes is used for the
user's password. If this textbox has the attribute
TextMode="SingleLine" (ie the default) in the HTML,
everything works fine.

If I change the HTML to say TextMode="Password", the
textbox comes up blank when modifying the record, even
though debugging the code behind confirms that the
password was successfully retrieved and entered into the
textbox's Text property.

What gives?
Nov 18 '05 #1
4 5750
Sending the password in plain text to the browser is a bad idea from a
security standpoint so the default security settings discourage it.
(Anybody can do a view source for the page
and see the password)

However there is a workaround. You must set the password text via
clientside script.
Here's the simplest example I've seen:

MyPWTextBox.Attributes.Add("value", strPassword)

This server side code outputs the needed client side code

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Jonathan Dienst" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
I have a simple data access and administration page for
user details on my site, including a login password --
but I cannot get the textbox to work properly if the
TextMode is set to "Password".

The user details are modified in making a hidden table
with textboxes visible -- in response an edit command
from the datagrid. One of the textboxes is used for the
user's password. If this textbox has the attribute
TextMode="SingleLine" (ie the default) in the HTML,
everything works fine.

If I change the HTML to say TextMode="Password", the
textbox comes up blank when modifying the record, even
though debugging the code behind confirms that the
password was successfully retrieved and entered into the
textbox's Text property.

What gives?

Nov 18 '05 #2
It seems to me that this is exactly the point. If you editing password you
don't want it to be presented on the screen where other people may see it
over your shoulder...
Nov 18 '05 #3
Thanks Steve - that sorted the problem out.

This particular app is designed to run over an intranet
and does not contain any really sensitive information, so
the security requirements are modest.

In those cases where the security requirements are more
sever, what is the recommended way of allowing the users
to modify their passwords for a web app?

Regards
Jonathan Dienst
-----Original Message-----
Sending the password in plain text to the browser is a bad idea from asecurity standpoint so the default security settings discourage it.(Anybody can do a view source for the page
and see the password)

However there is a workaround. You must set the password text viaclientside script.
Here's the simplest example I've seen:

MyPWTextBox.Attributes.Add("value", strPassword)

This server side code outputs the needed client side code

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able- consulting.com
"Jonathan Dienst" <an*******@discussions.microsoft.com> wrote in messagenews:03****************************@phx.gbl...
I have a simple data access and administration page for
user details on my site, including a login password --
but I cannot get the textbox to work properly if the
TextMode is set to "Password".

The user details are modified in making a hidden table
with textboxes visible -- in response an edit command
from the datagrid. One of the textboxes is used for the
user's password. If this textbox has the attribute
TextMode="SingleLine" (ie the default) in the HTML,
everything works fine.

If I change the HTML to say TextMode="Password", the
textbox comes up blank when modifying the record, even
though debugging the code behind confirms that the
password was successfully retrieved and entered into the textbox's Text property.

What gives?

.

Nov 18 '05 #4
Well the standard approach would be something like this:

Enter Old Password:
*******

Enter New Password:
*******

Confirm New Password:
*******

You would normally never want to display their password on the screen if it
can be avoided.
If they forget their password you can email it to them and/or generate a new
password for them.
Secret Question & Answer pairs are an alternate way to authenticate someone
if they forget their password.
Of course the subject of security is deep. There are entire books written
on the subject.
Here's more info for you:
http://msdn.microsoft.com/library/de...SecNetch03.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Jonathan Dienst" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
Thanks Steve - that sorted the problem out.

This particular app is designed to run over an intranet
and does not contain any really sensitive information, so
the security requirements are modest.

In those cases where the security requirements are more
sever, what is the recommended way of allowing the users
to modify their passwords for a web app?

Regards
Jonathan Dienst
-----Original Message-----
Sending the password in plain text to the browser is a

bad idea from a
security standpoint so the default security settings

discourage it.
(Anybody can do a view source for the page
and see the password)

However there is a workaround. You must set the

password text via
clientside script.
Here's the simplest example I've seen:

MyPWTextBox.Attributes.Add("value", strPassword)

This server side code outputs the needed client side code

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-

consulting.com

"Jonathan Dienst" <an*******@discussions.microsoft.com>

wrote in message
news:03****************************@phx.gbl...
I have a simple data access and administration page for
user details on my site, including a login password --
but I cannot get the textbox to work properly if the
TextMode is set to "Password".

The user details are modified in making a hidden table
with textboxes visible -- in response an edit command
from the datagrid. One of the textboxes is used for the
user's password. If this textbox has the attribute
TextMode="SingleLine" (ie the default) in the HTML,
everything works fine.

If I change the HTML to say TextMode="Password", the
textbox comes up blank when modifying the record, even
though debugging the code behind confirms that the
password was successfully retrieved and entered into the textbox's Text property.

What gives?

.

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John | last post by:
Hi, I have a textbox control, when I set the textmode to password, then bind or set some text to it, the textbox become empty, but when I change the textmode to singleline or delete the textmode,...
2
by: ChInKPoInt [No MCSD] | last post by:
1. Is there anyway to preload password? Text attribute doesn't work <asp:TextBox ID="Pass" TextMode="Password" Runat="server" Text="Hello"> 2. In the same form, if other elements such as...
0
by: Kumar | last post by:
Hello All, I am trying the following in one of the DataGrid column. The intent is to enable users to edit their password without actually displaying it. <asp:TextBox id='Password'...
2
by: Kerri | last post by:
Hi, I have an asp textbox that allows users to enter their password. I have another page that allows a user to edit their user account. On this page I set the text to be the password in...
1
by: Ather Ali Shaikh | last post by:
Hello I have a control TextBox with TextMode = Password fine. I am suppose to save LoginID and Password in a cookie fine. But when I read the cookie and display the key/values of the LoginID and...
3
by: William Gower | last post by:
I have a password mode field in a user record, when I go to fill the field from an existing record I see nothing in the field, when I take the textmode="password" off then I see the password ...
1
by: Jeff | last post by:
hey asp.net 2.0 I'm trying to create a web page where users can register to my web portal. But I've run into a layout problem when using the data validator classes. The problem is that the...
6
by: SenthilVel | last post by:
hi all, i am running a ASP.Net 2.0 application. in one of the pages i have a text box which is set as PASSWORD mode. when the page is submitted or transfered , am not able to get the contents of...
4
by: John Kotuby | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.