不要求保存密码

问题描述:

我正在使用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控件。

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

我已经使用了已经回答的一切。但没有为我工作。这就是我刚刚问过的原因。我搜索了很多可能的方法,都失败了。这不是重复的。

+0

这是一个浏览器的功能,并没有什么与你的代码。 – Knelis

+0

大多数浏览器应该有一个“从不为这个网站保存”选项。只需点击它。 – CodesInChaos

+0

与我的代码有什么关系?我准备好做任何事情。我只是想阻止提示。我有用户'AutocompleteType =“Disabled”'也.. – Sakthi

在HTML表单设置属性自动完成=“关闭”

<form autocomplete="off" id="form1"> 
+0

你想在“”或其他任何地方的开始或之前添加什么? – Sakthi

+0

在你的标记中,asp:Login控件应该在表单控件中,在表单上设置autocomplete =“off”。 –