[英]C# password TextBox in a ASP.net website
我正在嘗試創建一個ASP .NET網站,在用戶輸入時屏蔽注冊頁面中的密碼。 我發現使用Windows窗體的網站,但它不適用於ASP .NET網站。
因此,如果用戶輸入密碼,則將其屏蔽為這樣
*******
任何關於如何讓它工作的網站或建議都會很棒。
要用ASP.NET方式做到這一點:
<asp:TextBox ID="txtBox1" TextMode="Password" runat="server" />
//在aspx頁面中
<asp:TextBox ID="password" runat="server" TextMode="Password" />
//在MVC cshtml中
@Html.Password("password", "", new { id = "password", Textmode = "Password" })
@JohnHartsock:你也可以寫type =“password”。 它在aspx中是可以接受的。
<asp:TextBox ID="txtBox" type="password" runat="server"/>
我想這就是你要找的東西
<asp:TextBox ID="txbPass" runat="server" TextMode="Password"></asp:TextBox>
只需選擇texbox屬性'TextMode'並選擇密碼...
<asp:TextBox ID="TextBox1" TextMode="Password" runat="server" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.