Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

default value for asp.net textbox -> TextMode = password

please see the link below :
https://www.boot-loader.com/eng
how does default password in that link work?
how can i have a default value such as "password" string for textbox below (with asterisks) :

                    <asp:TextBox ID="headertxtPassWord" runat="server" Text="password" CssClass="header-login-input" ValidationGroup="A"
                        TextMode="Password"></asp:TextBox>  
like image 750
SilverLight Avatar asked Nov 19 '25 03:11

SilverLight


2 Answers

In codebehind, you can do this:

headertxtPassWord.Attributes.Add("value", "ThePassword");

Use this to set the value, instead of setting the Text property. You can still read the value from the control via the Text property.

like image 192
Duc Tran Avatar answered Nov 21 '25 01:11

Duc Tran


Ok I think I did not understand you correctly.

Here you can find the answer with some background and explanation Basically the point is that MS prevents showing default password from security reasons and this should be done in code behind to avoid unveiling password to others.

Hope this will help.

like image 25
Szymon Kuzniak Avatar answered Nov 21 '25 03:11

Szymon Kuzniak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!