Link to home
Start Free TrialLog in
Avatar of CipherIS
CipherISFlag for United States of America

asked on

ASP.NET Textbox Prob on AutoPostback

I have an ASP.NET page with four textboxes.  

First two are FirstName and LastName.  The values are populated from the database.

The next two are Password and ConfirmPassword.  When I enter a value in the Password text box and click on the submit button the value disappears from the Password textbox.

Any idea how to resolve?
SOLUTION
Avatar of Guru Ji
Guru Ji
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Rajar Ahmed
Rajar Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sample textbox

<asp:TextBox ID="TextBox1" runat="server"

   onkeydown = "return (event.keyCode!=13);" >

</asp:TextBox>

You can also do codebehind like this if using c#
TextBox1.Attributes.Add("onkeydown", "return (event.keyCode!=13);");
Avatar of CipherIS

ASKER

the issue is i have not identified the textbox as a password yet.  I am testing it and exposing the text being typed.  It disappears as soon as i click on the submit button and the value = "".
below does not work

TextBox1.Attributes.Add("onkeydown", "return (event.keyCode!=13);");
I figured it out.  It was a coding issue.  On the load event I was setting the value = string.empty.
Figured it out