2015-06-22 96 views
0

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

回答

0

在HTML表單設置屬性自動完成=「關閉」

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

你想在「」或其他任何地方的開始或之前添加什麼? – Sakthi

+0

在你的標記中,asp:Login控件應該在表單控件中,在表單上設置autocomplete =「off」。 –