473,320 Members | 1,814 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,320 software developers and data experts.

password fields

why is it that password fields:

<asp:TextBox Id="txtuserpassword1" TextMode="password" 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 2509
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="txtuserpassword1" TextMode="password" 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:

txtuserpassword1.Text = "" & memberdata("USER_PASSWORD")
txtuserpassword2.Text = "" & memberdata("USER_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="txtuserpassword1" TextMode="password" 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="txtuserpassword1" TextMode="password" 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:

txtuserpassword1.Attributes.Add("value",myPassedVa lue);

-- bruce (sqlwork.com)

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
why is it that password fields:

<asp:TextBox Id="txtuserpassword1" TextMode="password" 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*************@TK2MSFTNGP10.phx.gbl...
asp.net clears password fields by default. to set the values in code behind use the value attribute:

txtuserpassword1.Attributes.Add("value",myPassedVa lue);

-- bruce (sqlwork.com)

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
why is it that password fields:

<asp:TextBox Id="txtuserpassword1" TextMode="password" 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
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...
20
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...
7
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,...
4
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...
8
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...
1
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...
2
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...
1
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...
3
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.