Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent a password input from clearing after submit?

Tags:

If you have a page with an <asp:TextBox TextMode="Password" ... />.
How can you keep the value after a postback?

This is my problem:
At the registration screen of my app you need to enter a password. Then you click submit, a postback occurs and the password fields are cleared, how can I prevent the password field from clearing?

like image 843
user29964 Avatar asked Jun 30 '10 08:06

user29964


People also ask

Which tag is used for password protection?

The <input type="password"> defines a password field (characters are masked). Note: Any forms involving sensitive information like passwords should be served over HTTPS. Tip: Always add the <label> tag for best accessibility practices!

How can we keep TextBox value after PostBack in asp net?

One of the common interview question is “Explain the use of ViewState for TextBox?” and the most popular and common answer for this question is view state will maintain the text property value of the TextBox after a PostBack of the page.

How do you make a password invisible in HTML?

<input type = "password" > Thus the entered characters are masked or hidden. To make a textbox that can hide the entered characters, the type attribute of <input> element should be set to "password."


1 Answers

You require to set it again in page_load or in button click event like this :

 string Password = txtPassword.Text;
txtPassword.Attributes.Add("value", Password);
like image 145
Pranay Rana Avatar answered Sep 28 '22 08:09

Pranay Rana