473,785 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

password fields

why is it that password fields:

<asp:TextBox Id="txtuserpass word1" TextMode="passw ord" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br>

clear everytime validation kicks in or on page refreshes? Can this be stopped? Help!
Also, I can't auto-populate the password field uising a database value.

Help. Thanx.

Nov 18 '05 #1
5 2526
This is the default behavior. If password fields were to refresh, they would have to be stored in ViewState. Since ViewState is stored on the HTML rendered to the browser, the user can easily do a view source and have access to the password. This defeats the purpose of having the password masked.

There is no way to override this, unless you make a custom control, or some other work around.

hope this helps,
John

"Chris" wrote:
why is it that password fields:

<asp:TextBox Id="txtuserpass word1" TextMode="passw ord" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br>

clear everytime validation kicks in or on page refreshes? Can this be stopped? Help!
Also, I can't auto-populate the password field uising a database value.

Help. Thanx.

Nov 18 '05 #2
ok, I can buy the "refresh" reason but what about setting to a value via a database call:

txtuserpassword 1.Text = "" & memberdata("USE R_PASSWORD")
txtuserpassword 2.Text = "" & memberdata("USE R_PASSWORD")

they won't populate, why?
thanx.

"John Sivilla" wrote:
This is the default behavior. If password fields were to refresh, they would have to be stored in ViewState. Since ViewState is stored on the HTML rendered to the browser, the user can easily do a view source and have access to the password. This defeats the purpose of having the password masked.

There is no way to override this, unless you make a custom control, or some other work around.

hope this helps,
John

"Chris" wrote:
why is it that password fields:

<asp:TextBox Id="txtuserpass word1" TextMode="passw ord" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br>

clear everytime validation kicks in or on page refreshes? Can this be stopped? Help!
Also, I can't auto-populate the password field uising a database value.

Help. Thanx.

Nov 18 '05 #3
My guess is it's built into the design of the server control. It would
seem to be a security risk to allow prepopulating a password field.
Perhaps you could do a JavaScript kludge to work around it though if you
really had to.

Chris wrote:
why is it that password fields:

<asp:TextBox Id="txtuserpass word1" TextMode="passw ord" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br>

clear everytime validation kicks in or on page refreshes? Can this be stopped? Help!
Also, I can't auto-populate the password field uising a database value.

Help. Thanx.


Nov 18 '05 #4
asp.net clears password fields by default. to set the values in code behind
use the value attribute:

txtuserpassword 1.Attributes.Ad d("value",myPas sedValue);

-- bruce (sqlwork.com)

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:53******** *************** ***********@mic rosoft.com...
why is it that password fields:

<asp:TextBox Id="txtuserpass word1" TextMode="passw ord" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br>
clear everytime validation kicks in or on page refreshes? Can this be stopped? Help! Also, I can't auto-populate the password field uising a database value.

Help. Thanx.

Nov 18 '05 #5
This will work, but for security reasons, I would recommend not putting the
actual password value in there (as it can then become visible to the user if
they view source). Rather, I've often put in "********" as the value to
represent that something has been entered. The next time the user posts, if
that value matches, then I know they left it alone and the code responds
accordingly. Otherwise, they've made a change.

Ben Lucas
Lead Developer
Solien Technology, Inc.

"bruce barker" <no***********@ safeco.com> wrote in message
news:OO******** *****@TK2MSFTNG P10.phx.gbl...
asp.net clears password fields by default. to set the values in code behind use the value attribute:

txtuserpassword 1.Attributes.Ad d("value",myPas sedValue);

-- bruce (sqlwork.com)

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:53******** *************** ***********@mic rosoft.com...
why is it that password fields:

<asp:TextBox Id="txtuserpass word1" TextMode="passw ord" class="textbox"

maxlength="20" Columns="15" Runat="Server" /><br>

clear everytime validation kicks in or on page refreshes? Can this be

stopped? Help!
Also, I can't auto-populate the password field uising a database value.

Help. Thanx.


Nov 18 '05 #6

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

Similar topics

4
6078
by: Lobang Trader | last post by:
Hi all, I am trying to create a username and a password class. I would like to know what are the RECOMMENDED minimum and maximum length for both fields? These fields will be something like this: private static final int DEFAULT_MINIMUM_LENGTH = ??????
20
3559
by: David | last post by:
Hi, I have a field from my recordset called RS("Password"). If I wish to display each character as an asterix '*' how do I go about it. I've seen the replace function, but cannot work out how to do it for how ever many characters there are in the record ? Appreciate your help
7
8695
by: Mike | last post by:
I've been trying for the past week to put a simple code together. I have done a LOT of searching, found scripts showing the functions I would like to use, however when I mix them it all goes wrong, somehow I always end up with error messages and functions not working right. Can someone please help me? I have a form, inside is 1 Text Field and 2 Password Fields. What I'm looking to do is: - Make sure password fields are equal - Set...
4
1819
by: MS | last post by:
Access 97 I'm trying to check a table and add fields if necessary using code to a BE MDB. At the moment I'm reconnecting to the BE using code based on code written by Peter Vukovic 100700.1262@compuserve.com It works extremely well - very useful if you want a split database, but need to move it from folder to folder or computer to computer without having
8
2138
by: dwa | last post by:
All, We're trying to determine how to deal with password fields losing their state on a post back. We've got a form that implements post backs to carry out server side processing. As a result of the post back, passwords entered by the user lose their values and the user gets an error message upon final validation when they submit. Here's an illustration
1
2369
by: dwa | last post by:
All, We're trying to determine how to deal with password fields losing their state on a post back. We've got a form that implements post backs to carry out server side processing. As a result of the post back, passwords entered by the user lose their values and the user gets an error message upon final validation when they submit. Here's an illustration:
2
1187
by: Elroyskimms | last post by:
The form has two text fields... one called txtEmail and one called txtPassword. The username is the email address (txtEmail) and the password is txtPassword. Storing cookie using the following code: Response.Cookies("Email").Value = txtEMail.Text Response.Cookies("Email").Expires = DateTime.Now.AddDays(30) The cookie is accessed using the following code: txtEMail.Text = Request.Cookies("Email").Value
1
4545
by: znadeem | last post by:
Hi, I am new to JavaScript and I am trying to control New Password fields. These fields are not allowed to except any symbols, especially @ / \. The current code I've is not working at all. Could someone help please. function changepass_submit() { if (document.Eform.USERNAME.value=="") { alert("Please Enter Value for Username"); document.Eform.USERNAME.focus();} else if (document.Eform.PASSWORD.value=="") { alert("Please Enter Value...
3
2996
by: Nathan Sokalski | last post by:
I have an UpdatePanel that needs to maintain the value of several TextBoxes with TextMode=Password. Since the browser clears all password fields client-side, I obviously need to use JavaScript to do this. Can someone help me? Thanks. Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10324
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10090
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.