Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Friday, March 16, 2012

Password Field

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?

Thanksthe 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" <minorkeys@.gmail.com> wrote in message
news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
> 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
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" <brubar_nospamplease_@.safeco.com> wrote in message
news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
> 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" <minorkeys@.gmail.com> wrote in message
> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>> 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
>>
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" <minorkeys@.gmail.com> wrote in message
news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
> 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" <brubar_nospamplease_@.safeco.com> wrote in message
> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>> 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" <minorkeys@.gmail.com> wrote in message
>> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>>> 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
>>>
>>
>>
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" <someone@.nospam.com> wrote in message
news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
> 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" <minorkeys@.gmail.com> wrote in message
> news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
>> 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" <brubar_nospamplease_@.safeco.com> wrote in message
>> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>>> 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" <minorkeys@.gmail.com> wrote in message
>>> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>>>> 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
>>>>
>>>
>>>
>>
>>
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" <minorkeys@.gmail.com> wrote in message
news:uzLRXrjEGHA.1032@.TK2MSFTNGP11.phx.gbl...
> 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" <someone@.nospam.com> wrote in message
> news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
>> 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" <minorkeys@.gmail.com> wrote in message
>> news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
>>> 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" <brubar_nospamplease_@.safeco.com> wrote in message
>>> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>>>> 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" <minorkeys@.gmail.com> wrote in message
>>>> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>>>>> 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
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
Thanks for the help, this seems to work on Postback:

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

"Marina" <someone@.nospam.com> wrote in message
news:eKbInxjEGHA.216@.TK2MSFTNGP15.phx.gbl...
>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" <minorkeys@.gmail.com> wrote in message
> news:uzLRXrjEGHA.1032@.TK2MSFTNGP11.phx.gbl...
>> 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" <someone@.nospam.com> wrote in message
>> news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
>>> 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" <minorkeys@.gmail.com> wrote in message
>>> news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
>>>> 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" <brubar_nospamplease_@.safeco.com> wrote in message
>>>> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>>>>> 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" <minorkeys@.gmail.com> wrote in message
>>>>> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>

Password field

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?
When I use the Textbox Field (from Toolbox - Standard), I did not find
anything there that can make it a password field.
When I use the Input (Password) Field (From Toolbox - HTML), in my
Submit command button when I do Request.Form("txtPassword") or
Request.QueryString("txtPassword") it returns nothing.

This is from Page1.aspx
<input id="txtPassword" type="password" />

This is from Page1.aspx.vb:
Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSubmit.Click
sPassword = Request.Form("txtPassword") --nothing

Thank you.<fiefie.niles@.gmail.comwrote in message
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.

On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

<fiefie.ni...@.gmail.comwrote in message
>
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
>

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />


You can only click on that hyperlink from a newsreader, not from a browser.

Notice the news: protocol

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...

Quote:

Originally Posted by

When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.
>
On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

><fiefie.ni...@.gmail.comwrote in message
>>
>news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
>>

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


>>
><asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />


>
>


<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...

Quote:

Originally Posted by

When I click on the hyperlink you wrote


What hyperlink...?
See my earlier reply, MArk.

He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.

He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Mark Rae" <mark@.markNOSPAMrae.netwrote in message news:O5dS0pShHHA.1312@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...
>

Quote:

Originally Posted by

>When I click on the hyperlink you wrote


>
What hyperlink...?
>


"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message
news:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

See my earlier reply, MArk.
>
He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.
>
He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.


Ah right...
Oh, I see your reply. I got it. Sorry about the confusion.
That works !
Thanks a lot.

On Apr 22, 5:51 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

"Juan T. Llibre" <nomailrepl...@.nowhere.comwrote in messagenews:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gb l...
>

Quote:

Originally Posted by

See my earlier reply, MArk.


>

Quote:

Originally Posted by

He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.


>

Quote:

Originally Posted by

He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.


>
Ah right...

password field cant be preloaded

Hi,

I have a quick question.

I have a webpage allow user to modify his/her information. When I
generate the form, I want to pre-load the information to the
TextBoxes. But for the password (and confirm password) textbox, the
text can't be loaded (the TextBoxes are empty, no "dot" in them). I
checked inside Page_Load the text is loaded, but when the page is
render, the data is flushed.

I read some ASP code that in ASP this won't happen, you just do:

<input type="password" name="vcPassword" value="<%=vcPassword%>"
Please Help

Homa WongYou're not supposed to set the text of a password field from the server
because it's unsecure. That's why it didn't show up; it's prevented as a
security precaution. (The password would be plain text to anybody who views
the source of the page.)

However there is a workaround if you are willing to accept this risk.
Here's the simplest example I've seen:

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

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

"Homa" <homaneag@.yahoo.com> wrote in message
news:a9a6fc0b.0310201646.1763edf0@.posting.google.c om...
> Hi,
> I have a quick question.
> I have a webpage allow user to modify his/her information. When I
> generate the form, I want to pre-load the information to the
> TextBoxes. But for the password (and confirm password) textbox, the
> text can't be loaded (the TextBoxes are empty, no "dot" in them). I
> checked inside Page_Load the text is loaded, but when the page is
> render, the data is flushed.
> I read some ASP code that in ASP this won't happen, you just do:
> <input type="password" name="vcPassword" value="<%=vcPassword%>">
>
> Please Help
> Homa Wong
You're not supposed to set the text of a password field from the server
because it's unsecure. That's why it didn't show up; it's prevented as a
security precaution. (The password would be plain text to anybody who views
the source of the page.)

However there is a workaround if you are willing to accept this risk.
Here's the simplest example I've seen:

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

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

"Homa" <homaneag@.yahoo.com> wrote in message
news:a9a6fc0b.0310201646.1763edf0@.posting.google.c om...
> Hi,
> I have a quick question.
> I have a webpage allow user to modify his/her information. When I
> generate the form, I want to pre-load the information to the
> TextBoxes. But for the password (and confirm password) textbox, the
> text can't be loaded (the TextBoxes are empty, no "dot" in them). I
> checked inside Page_Load the text is loaded, but when the page is
> render, the data is flushed.
> I read some ASP code that in ASP this won't happen, you just do:
> <input type="password" name="vcPassword" value="<%=vcPassword%>">
>
> Please Help
> Homa Wong
It's a security issue. If you want your applications to be secure you should
only store hashed password values so you will never be able to know the
original password. And in any case you should not be sending passwords to
anybody, not even the original user.

Jerry

"Homa" <homaneag@.yahoo.com> wrote in message
news:a9a6fc0b.0310201646.1763edf0@.posting.google.c om...
> Hi,
> I have a quick question.
> I have a webpage allow user to modify his/her information. When I
> generate the form, I want to pre-load the information to the
> TextBoxes. But for the password (and confirm password) textbox, the
> text can't be loaded (the TextBoxes are empty, no "dot" in them). I
> checked inside Page_Load the text is loaded, but when the page is
> render, the data is flushed.
> I read some ASP code that in ASP this won't happen, you just do:
> <input type="password" name="vcPassword" value="<%=vcPassword%>">
>
> Please Help
> Homa Wong
It's a security issue. If you want your applications to be secure you should
only store hashed password values so you will never be able to know the
original password. And in any case you should not be sending passwords to
anybody, not even the original user.

Jerry

"Homa" <homaneag@.yahoo.com> wrote in message
news:a9a6fc0b.0310201646.1763edf0@.posting.google.c om...
> Hi,
> I have a quick question.
> I have a webpage allow user to modify his/her information. When I
> generate the form, I want to pre-load the information to the
> TextBoxes. But for the password (and confirm password) textbox, the
> text can't be loaded (the TextBoxes are empty, no "dot" in them). I
> checked inside Page_Load the text is loaded, but when the page is
> render, the data is flushed.
> I read some ASP code that in ASP this won't happen, you just do:
> <input type="password" name="vcPassword" value="<%=vcPassword%>">
>
> Please Help
> Homa Wong

Password Field and Session Vars

Hey, I'm not sure what happened, but I ran into a simple problem I can't figure out.

All I'm trying to do is read two text boxes, txtUserEmail and txtUserPassword. I then take the txtUserEmail value and pass it into a stored proc, which matches it against an Email address in the MSDE. The stored proc returns the UserEmail, UserPassword, UserGroup (role) and UserEmailConfirm.

All I wanted to do is check txtUserEmail.text and txtUserPassword vs the UserEmail and UserPassword fields in my table that I'm getting back from the stored proc. Based on a match, I want to set a couple of Session vars.

fnReturnDataSet is in another module. It takes the stored proc call and returns the data set with the appropriate information.

The problem is that the Sub is skipping over the FOR loop and I'm not sure why. I know I'm only returning one row, but it's easy to just use this temeplate to get the dataset since it's working on 4 other pages I wrote.

If anyone could give me a hint what's wrong, I'd appriciate it.

--------------

Protected Sub btnUserLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUserLogin.Click
Dim strUserEmail, strUserPassword As String
Dim objSQL As String
Dim dsUserInfo As DataSet
Dim row As DataRow

strUserEmail = txtUserEmail.Text
strUserPassword = txtUserPassword.Text

objSQL = "EXECUTE spValidateUser '" & strUserEmail & "'"
dsUserInfo = fnReturnDataSet(objSQL)

For Each row In dsUserInfo.Tables("dtReturnedTable").Rows
If (row("UserEmail") = strUserEmail) And (row("UserPassword") = strUserPassword) And (row("UserEmailConfirm") = "yes") Then
Session("User") = row("UserEmail")
Session("UserGroup") = row("UserGroup")
lblConfirm.Text = "You are now logged in"
Else
lblError.Text = "The username or password provided are not valid"
End If
Next
End Subhello, have u tried to add
row("UserEmail").ToString() = strUserEmail ...

try it.
I actually figured everything out, but thank you for the suggestion.

I also found an article with some encryption classes to use:
http://www.15seconds.com/issue/021210.htm

I have the cookie encrypted as far as I can tell. I set one key to the UserName and a second to a UserRole. I just need to encrypt the passwords in my SQL database and I should be all set.

Eric

Password Field

In using VB.NET, I noticed that their was a field titled Password Char for Textfields.

I am currently designing a sign on screen using asp.net, but that particular field is unavailable while using webforms. Is their a quick way around this or way to set this field while using web forms?Hello, isn't the password field textfield that you want ? It should be placed on the list of server controls on your left if you are using Vs.NET 2003.
It should be a simple login (username/password) page.

regards.
Drag an asp:textbox control from the library and set its type to "password"

Password field

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?
When I use the Textbox Field (from Toolbox - Standard), I did not find
anything there that can make it a password field.
When I use the Input (Password) Field (From Toolbox - HTML), in my
Submit command button when I do Request.Form("txtPassword") or
Request.QueryString("txtPassword") it returns nothing.
This is from Page1.aspx
<input id="txtPassword" type="password" />
This is from Page1.aspx.vb:
Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSubmit.Click
sPassword = Request.Form("txtPassword") --> nothing
Thank you.<fiefie.niles@.gmail.com> wrote in message
news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...

> In ASP.Net I would like to create a text box that is a Password Field.
> How do I do that ?
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.
On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
> <fiefie.ni...@.gmail.com> wrote in message
> news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
>
> <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
You can only click on that hyperlink from a newsreader, not from a browser.
Notice the news: protocol
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<fiefie.niles@.gmail.com> wrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...
> When I click on the hyperlink you wrote
> news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
> it says "Page not found".
> Can you please retype the link ? Thank you very much.
> On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
>
<fiefie.niles@.gmail.com> wrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...

> When I click on the hyperlink you wrote
What hyperlink...?
See my earlier reply, MArk.
He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.
He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Mark Rae" <mark@.markNOSPAMrae.net> wrote in message news:O5dS0pShHHA.1312@.TK2MSFTNGP03.phx
.gbl...
> <fiefie.niles@.gmail.com> wrote in message
> news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...
>
> What hyperlink...?
>
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gbl...

> See my earlier reply, MArk.
> He means the news: protocol hyperlink which is quoted
> in your reply because you used a newsreader to reply to him.
> He's using a browser...and the news: protocol doesn't work in browsers
> unless it also has the double slashes and the server's address.
Ah right...
Oh, I see your reply. I got it. Sorry about the confusion.
That works !
Thanks a lot.
On Apr 22, 5:51 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
> "Juan T. Llibre" <nomailrepl...@.nowhere.com> wrote in messagenews:ezMak%23
ShHHA.3960@.TK2MSFTNGP02.phx.gbl...
>
>
>
> Ah right...

Password Field

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?
Thanksthe 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" <minorkeys@.gmail.com> wrote in message
news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
> 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
>
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" <brubar_nospamplease_@.safeco.com> wrote in message
news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
> 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" <minorkeys@.gmail.com> wrote in message
> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>
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" <minorkeys@.gmail.com> wrote in message
news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
> 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" <brubar_nospamplease_@.safeco.com> wrote in message
> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>
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" <someone@.nospam.com> wrote in message
news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
> 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" <minorkeys@.gmail.com> wrote in message
> news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
>
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" <minorkeys@.gmail.com> wrote in message
news:uzLRXrjEGHA.1032@.TK2MSFTNGP11.phx.gbl...
> 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" <someone@.nospam.com> wrote in message
> news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
>
Thanks for the help, this seems to work on Postback:
tbPassword.Attributes("value") = tbPassword.Text
"Marina" <someone@.nospam.com> wrote in message
news:eKbInxjEGHA.216@.TK2MSFTNGP15.phx.gbl...
>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" <minorkeys@.gmail.com> wrote in message
> news:uzLRXrjEGHA.1032@.TK2MSFTNGP11.phx.gbl...
>

password field: Syntax error in INSERT INTO statement.

Hello,
I am trying to execute ADO.NET INSERT statement where one of the
fields
is coming from a password HTML control. When I access the text with
password.Value and print with Response.Write so as to check that it
is working correctly it displays just fine. However, whenever I
include the password field in one of the SQL INSERT statement's
fields I get the following error:
Exception Details: System.Data.OleDb.OleDbException: Syntax error in
INSERT INTO statement.
Line 85: cmd.ExecuteNonQuery();
When I delete the password field from the insert statement things work
fine (so the problem is no longer related to NTFS file permissions).
Any ideas on how to solve this problem would be greatly appreciated.
Best Regards,
NeilNeil, it's difficult to pinpoint your problem without seeing some code; but
here are a few ideas to get you started;
If you're using a WebControls textbox (and not an HtmlControls input box),
then the correct accessor would be something like txtPassword.Text
Triple-check your SQL. Try modifying it so that the value you're entering
in the textbox is manually assigned to the SqlParam (or embedded in your sql
string, etc). That will help you debug your SQL, your schema, etc while
removing the textbox from the equation.
Try very simple passwords, e.g. "a". If that succeeds, you might be having
a problem with unescaped apostrophes or something similar.
If you can, display the generated Sql in a Trace.Write or a Response.Write,
and copy/paste it into your Sql tool to test it manually.
Best of luck,
/// M
"Neil Zanella" <nzanella@.gmail.com> wrote in message
news:1ac72686.0501221942.349922c2@.posting.google.com...
> Hello,
> I am trying to execute ADO.NET INSERT statement where one of the
> fields
> is coming from a password HTML control. When I access the text with
> password.Value and print with Response.Write so as to check that it
> is working correctly it displays just fine. However, whenever I
> include the password field in one of the SQL INSERT statement's
> fields I get the following error:
> Exception Details: System.Data.OleDb.OleDbException: Syntax error in
> INSERT INTO statement.
> Line 85: cmd.ExecuteNonQuery();
> When I delete the password field from the insert statement things work
> fine (so the problem is no longer related to NTFS file permissions).
> Any ideas on how to solve this problem would be greatly appreciated.
> Best Regards,
> Neil
Hello,
Thank you for your reply. I have already tried everything
you suggested. I also had a problem with calling
Response.Write to debug my SQL query as
whenever I use it the parameter holders
which begin with @. are not substituted
when I call Response.Write (is there
some special method I can call on
OleDbCommand to print the actual
query with the parameters
substituted in?)
Anyways, here was my problem: as strange as
it may sound, I renamed a field called "password"
in MS Access to "foo" and did the same in the
query contained in the code. I don't know how
come but that fixed it. Is there something
special about calling a table's field
"password" in MS Access which
causes the query error I was
experiencing'
Thanks,
Neil
It might be a reserved word in Access. In Sql Server you can use most
reserved words as column names, but you reference them in your sql using
[brackets].
Since you've identified it as an Access or .NET->Access issue, I'd also try
seaching some of those newsgroups.
<nzanella@.gmail.com> wrote in message
news:1106607939.521494.187670@.f14g2000cwb.googlegroups.com...
> Hello,
> Thank you for your reply. I have already tried everything
> you suggested. I also had a problem with calling
> Response.Write to debug my SQL query as
> whenever I use it the parameter holders
> which begin with @. are not substituted
> when I call Response.Write (is there
> some special method I can call on
> OleDbCommand to print the actual
> query with the parameters
> substituted in?)
> Anyways, here was my problem: as strange as
> it may sound, I renamed a field called "password"
> in MS Access to "foo" and did the same in the
> query contained in the code. I don't know how
> come but that fixed it. Is there something
> special about calling a table's field
> "password" in MS Access which
> causes the query error I was
> experiencing'
> Thanks,
> Neil
>

password field: Syntax error in INSERT INTO statement.

Hello,

I am trying to execute ADO.NET INSERT statement where one of the
fields
is coming from a password HTML control. When I access the text with
password.Value and print with Response.Write so as to check that it
is working correctly it displays just fine. However, whenever I
include the password field in one of the SQL INSERT statement's
fields I get the following error:

Exception Details: System.Data.OleDb.OleDbException: Syntax error in
INSERT INTO statement.

Line 85: cmd.ExecuteNonQuery();

When I delete the password field from the insert statement things work
fine (so the problem is no longer related to NTFS file permissions).

Any ideas on how to solve this problem would be greatly appreciated.

Best Regards,

NeilNeil, it's difficult to pinpoint your problem without seeing some code; but
here are a few ideas to get you started;

If you're using a WebControls textbox (and not an HtmlControls input box),
then the correct accessor would be something like txtPassword.Text

Triple-check your SQL. Try modifying it so that the value you're entering
in the textbox is manually assigned to the SqlParam (or embedded in your sql
string, etc). That will help you debug your SQL, your schema, etc while
removing the textbox from the equation.

Try very simple passwords, e.g. "a". If that succeeds, you might be having
a problem with unescaped apostrophes or something similar.

If you can, display the generated Sql in a Trace.Write or a Response.Write,
and copy/paste it into your Sql tool to test it manually.

Best of luck,

/// M

"Neil Zanella" <nzanella@.gmail.com> wrote in message
news:1ac72686.0501221942.349922c2@.posting.google.c om...
> Hello,
> I am trying to execute ADO.NET INSERT statement where one of the
> fields
> is coming from a password HTML control. When I access the text with
> password.Value and print with Response.Write so as to check that it
> is working correctly it displays just fine. However, whenever I
> include the password field in one of the SQL INSERT statement's
> fields I get the following error:
> Exception Details: System.Data.OleDb.OleDbException: Syntax error in
> INSERT INTO statement.
> Line 85: cmd.ExecuteNonQuery();
> When I delete the password field from the insert statement things work
> fine (so the problem is no longer related to NTFS file permissions).
> Any ideas on how to solve this problem would be greatly appreciated.
> Best Regards,
> Neil
Hello,

Thank you for your reply. I have already tried everything
you suggested. I also had a problem with calling
Response.Write to debug my SQL query as
whenever I use it the parameter holders
which begin with @. are not substituted
when I call Response.Write (is there
some special method I can call on
OleDbCommand to print the actual
query with the parameters
substituted in?)

Anyways, here was my problem: as strange as
it may sound, I renamed a field called "password"
in MS Access to "foo" and did the same in the
query contained in the code. I don't know how
come but that fixed it. Is there something
special about calling a table's field
"password" in MS Access which
causes the query error I was
experiencing??

Thanks,

Neil
It might be a reserved word in Access. In Sql Server you can use most
reserved words as column names, but you reference them in your sql using
[brackets].

Since you've identified it as an Access or .NET->Access issue, I'd also try
seaching some of those newsgroups.

<nzanella@.gmail.com> wrote in message
news:1106607939.521494.187670@.f14g2000cwb.googlegr oups.com...
> Hello,
> Thank you for your reply. I have already tried everything
> you suggested. I also had a problem with calling
> Response.Write to debug my SQL query as
> whenever I use it the parameter holders
> which begin with @. are not substituted
> when I call Response.Write (is there
> some special method I can call on
> OleDbCommand to print the actual
> query with the parameters
> substituted in?)
> Anyways, here was my problem: as strange as
> it may sound, I renamed a field called "password"
> in MS Access to "foo" and did the same in the
> query contained in the code. I don't know how
> come but that fixed it. Is there something
> special about calling a table's field
> "password" in MS Access which
> causes the query error I was
> experiencing??
> Thanks,
> Neil

Password Field not getting populated from Database

I have a web form password field that needs to show the password value as "****" from tha database. It seems that it all it shows is blank but when I change it to a regular text fiels it works. All I do is change the "TEXTMODE" property nothing more.

Any HelpHi,

ASP.NET TexBox just doesn't write out the text when it is in password mode, it's just security precaution. However if you absolutely need such feature, you can wrap it simply in a custom control.

C#


using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Joteke.Controls
{
public class MyTextBox : TextBox
{
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
base.AddAttributesToRender (writer);
if(this.TextMode == TextBoxMode.Password)
{
string text=this.Text;
if(text.Length > 0)
writer.AddAttribute(HtmlTextWriterAttribute.Value,text);
}
}

}
}

VB (translated from C# with a tool)


Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace Joteke.Controls

Public Class MyTextBox
Inherits TextBox

Protected Overrides Sub AddAttributesToRender(writer As HtmlTextWriter)
MyBase.AddAttributesToRender(writer)

If Me.TextMode = TextBoxMode.Password Then
Dim [text] As String = Me.Text

If [text].Length > 0 Then
writer.AddAttribute(HtmlTextWriterAttribute.Value, [text])
End If

End If

End Sub 'AddAttributesToRender
End Class 'MyTextBox
End Namespace 'Joteke.Controls


I don't mind that security feature the only problem is that when you go to update a user the password field is blank and if you made no change to the password field then it updates as "" instead of the previous value.

Any solution for this then ?
Well, the password is in the HTML after postback (rendered along with the HTML), that's the only part.

As I said, previous control allows you to prepopulate TextBox even in password mode.
FYI: I blogged this one here.

http://blogs.aspadvice.com/joteke/archive/2005/02/03/2531.aspx

There's also provided the shortcut solution, that is just adding the value to the Attributes collection when you wouldn't need to write a custom control.

Password field is cleared after postback

Hello,
I am developing a C# asp.net application.
I have a webform which contains 2 dropdowns and a textbox with
type="password".
On "SelectedIndexChanged" event of the first dropdown, there is a postback,
in order to fill the second dropdown according to the value selected in the
first dropdown.
The problem is that the password field which has been filled up before is
cleared after postback.
I know this is for security, but is there a way to keep the password'
Thank youdana lees wrote:

> Hello,
> I am developing a C# asp.net application.
> I have a webform which contains 2 dropdowns and a textbox with
> type="password".
> On "SelectedIndexChanged" event of the first dropdown, there is a
> postback, in order to fill the second dropdown according to the value
> selected in the first dropdown.
> The problem is that the password field which has been filled up before is
> cleared after postback.
> I know this is for security, but is there a way to keep the password'
> Thank you
Yes, you can add a "value" attribute to the password textbox on postback:
txtPassword.Attributes.Add("value", txtPassword.Text)
Ben
I have tried that and it didn't work. The field stayed empty...
"Ben Amada" <ben@.REpoMOweVErpick.com> wrote in message
news:OaFdNkA8FHA.3804@.TK2MSFTNGP12.phx.gbl...
> dana lees wrote:
>
is
> Yes, you can add a "value" attribute to the password textbox on postback:
> txtPassword.Attributes.Add("value", txtPassword.Text)
> Ben
>
dana lees wrote:

> I have tried that and it didn't work. The field stayed empty...
Hmm... not sure why that doesn't work. Are you using .NET v2.0? I've done
it in v1.1 without any problems.
Another option is to manually set the value of the password field via
JavaScript. There are several ways to do this.
One way is to create a hidden input field. On postback, put the password in
the hidden input field (i.e. txtHiddenPwd.Value = txtPwd.Text). Then with a
startup script or via the body tag's onload attribute, set the value of the
password textbox to the value of the hidden input field.
Ben
I am using version 1.1.
On debug, I see that i do have the value of the password after postback, i
just can't set the textbox with that value.
I have tried also java script:
document.all.txtPassword.InnerText = "some text";
and this doesn't work as well...
I don't need to use a hidden textbox becuase i do have the value after
postback, i just can't set the textbox's value to that value...
"Ben Amada" <ben@.REpoMOweVErpick.com> wrote in message
news:u2Kz1wA8FHA.4076@.tk2msftngp13.phx.gbl...
> dana lees wrote:
>
> Hmm... not sure why that doesn't work. Are you using .NET v2.0? I've
done
> it in v1.1 without any problems.
> Another option is to manually set the value of the password field via
> JavaScript. There are several ways to do this.
> One way is to create a hidden input field. On postback, put the password
in
> the hidden input field (i.e. txtHiddenPwd.Value = txtPwd.Text). Then with
a
> startup script or via the body tag's onload attribute, set the value of
the
> password textbox to the value of the hidden input field.
> Ben
>
dana lees wrote:

> I am using version 1.1.
> On debug, I see that i do have the value of the password after postback, i
> just can't set the textbox with that value.
> I have tried also java script:
> document.all.txtPassword.InnerText = "some text";
> and this doesn't work as well...
> I don't need to use a hidden textbox becuase i do have the value after
> postback, i just can't set the textbox's value to that value...
Server-side you can't set the textbox's value to the password. However,
with JavaScript (client-side) you should be able to set the value of the
textbox with or without a hidden input field. Without a hidden input field,
you could simply add a runat="server" attribute to the <body> tag, then on
the server-side during a postback, you can add an "onload" attribute to the
body tag specifying the password value. Like this:
===== HTML =====
<body id="myBody" runat="server">
===== Code-Behind =====
myBody.Attributes.Add("onload", _
"document.getElementById('txtPassword').value = '" & _
txtPassword.Text & "'")
(the C# syntax should be similar)
Also, in the code-behind, if Visual Studio doesn't recognize the "myBody"
control (which happens sometimes), you'll probably have to manually add the
control declaration to the code-behind:
Dim myBody As HtmlControls.HtmlGenericControl
... or instead of adding an "onload" attribute to the body tag, you could
use the RegisterStartupScript method to set the password textbox value.
Ben
dana lees wrote:

> I have tried also java script:
> document.all.txtPassword.InnerText = "some text";
> and this doesn't work as well...
By the way, what do you mean that it "doesn't work as well"? How about :
document.getElementById('txtPassword').value = "some text";
Ben
It worked, when using
document.getElementById('txtPassword').value = "some text";
Thank you very much :-)
"Ben Amada" <ben@.REpoMOweVErpick.com> wrote in message
news:%23G3ExQB8FHA.3200@.TK2MSFTNGP11.phx.gbl...
> dana lees wrote:
>
> By the way, what do you mean that it "doesn't work as well"? How about :
> document.getElementById('txtPassword').value = "some text";
> Ben
>
Dana,
As Ben suggested you can use assword.Attributes.Add("value",
txtPassword.Text) to set the password .But instead of txtPassword.Text you
should retrieve password text using
txtPassword.Attributes["value"].ToString().
"dana lees" wrote:

> I have tried that and it didn't work. The field stayed empty...
> "Ben Amada" <ben@.REpoMOweVErpick.com> wrote in message
> news:OaFdNkA8FHA.3804@.TK2MSFTNGP12.phx.gbl...
> is
>
>
Check out:
http://groups.google.com/group/micr...de23fa30643fa4e
and
http://groups.google.com/group/micr...f9f3be06c4f0396
(watch for link brakage). Basically, you need to reset the value manually
via Password.Attributes.Add("value", Password.Text) or something
karl
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!
"dana lees" <danal@.idc.ac.il> wrote in message
news:%23jWQj9$7FHA.4036@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I am developing a C# asp.net application.
> I have a webform which contains 2 dropdowns and a textbox with
> type="password".
> On "SelectedIndexChanged" event of the first dropdown, there is a
> postback,
> in order to fill the second dropdown according to the value selected in
> the
> first dropdown.
> The problem is that the password field which has been filled up before is
> cleared after postback.
> I know this is for security, but is there a way to keep the password'
> Thank you
>

Password goes blank. When I make round trip to server

I have a simple Data Entry form that User enters some information....One of these fields is a password field...Now i have a textBox and and the TextMode is set to Password...but I am unable to save the password to the database cause when i check a check box who's AutoPostBack is set to true the text in textbox with its text mode set to password just goes back to being blank when the page reloads....I dont understand why...I am using ASP.Net 1.1 VS 03 and Sql Backend......I just want to be able to save my Passwords to the DB so that the user will be able to log in and I can authenicate him..........

More then likely you are blanking it in the Page_Load()

Ensure you have a:
If Not IsPostBack() then
... clear password
End if


I thought that but when I change the text mode to Single line...it works just fine....

I've seen the same behavior. I believe this is a security feature. You can use the following approach to work around it.

PrivateSub Page_PreRender(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMyBase.PreRender

Password.Attributes.Add(

"value", Password.Text)

ConfirmPassword.Attributes.Add(

"value", ConfirmPassword.Text)EndSub