停止要求保存密码

时间:2015-06-22 10:55:11

标签: c# asp.net

我正在使用ASP.NET 2008创建一个登录页面为“Login.aspx”的Web应用程序。在那我用控制。在里面,我已经创建了一个表格结构来放置控件,并且我已经放置了用户名和密码文本框。

<asp:Login ID="LoginUser" LoginButtonStyle-CssClass="CommonButton" runat="server" 
    OnLoggedIn="LoginUser_LoggedIn" OnLoginError="LoginUser_Error" TitleText="" 
    Width="100%" DisplayRememberMe="true" OnLoggingIn="LoginUser_LoggingIn">
  <div style="margin-left: auto; margin-right: auto;">
     <table border="0" cellpadding="0" style="margin-left: auto; margin-right: auto;">
         <tr>
           <td style="padding-bottom: 8px;">
              <asp:TextBox ID="UserName" runat="server" autocomplete="off" CssClass="CommonTextBox" Width="325" TextMode="SingleLine"></asp:TextBox>
           </td>
         </tr>
         <tr>
           <td>
              <asp:TextBox ID="Password" runat="server" autocomplete="off"  CssClass="CommonTextBox" Width="325" TextMode="Password"></asp:TextBox>
           </td>
        </tr>
      </table>
    </div>
</asp:Login>

现在,当我输入用户名和密码时,浏览器会提示输入保存密码。但我不需要那个提示。

我没有使用任何HTML控件。它的所有ASP.NET控件。

如何阻止浏览器提示..?

我已经使用了已经回答的所有内容。但没有什么对我有用。这就是我新问的原因。我搜索了许多可能的方法,但都失败了。这不是重复的。

1 个答案:

答案 0 :(得分:0)

在HTML设置的表单中,属性autocomplete =&#34; off&#34;

<form autocomplete="off" id="form1">
相关问题