搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Disable Save Password Prompt in firefox (v.61) from aspx (autocomplete="off" not working)

  • 2 个回答
  • 1 人有此问题
  • 4 次查看
  • 最后回复者为 cor-el

more options

I want to disable the Save Password Prompt in firefox in my login aspx page (not directly by changing the settings in firefox). I have used autocomplete="off", it works in IE and chorme but not in firefox. Can you please provide me a solution. Below is my simple login aspx :

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style4 {
            width: 400px;
        }
        .auto-style6 {
            width: 140px;
        }
        .auto-style7 {
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table align="center" class="auto-style4">
        <tr>
            <td class="auto-style7" colspan="2">LOGIN</td>
        </tr>
        <tr>
            <td class="auto-style6">Customer Id</td>
            <td>
                <asp:TextBox ID="txtUsername" runat="server" autocomplete="off"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style6">Password</td>
            <td>
                <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" autocomplete="off"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style6">&nbsp;</td>
            <td>
                <asp:Button ID="btnSubmitLogin" runat="server" OnClick="btnSubmitLogin_Click" Text="Login" />
            </td>
        </tr>
        <tr>
            <td style="align-content:center">
                <asp:Label ID="lblMessage" runat="server"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
I want to disable the Save Password Prompt in firefox in my login aspx page (not directly by changing the settings in firefox). I have used autocomplete="off", it works in IE and chorme but not in firefox. Can you please provide me a solution. Below is my simple login aspx : <pre><nowiki><%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .auto-style4 { width: 400px; } .auto-style6 { width: 140px; } .auto-style7 { text-align: center; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <table align="center" class="auto-style4"> <tr> <td class="auto-style7" colspan="2">LOGIN</td> </tr> <tr> <td class="auto-style6">Customer Id</td> <td> <asp:TextBox ID="txtUsername" runat="server" autocomplete="off"></asp:TextBox> </td> </tr> <tr> <td class="auto-style6">Password</td> <td> <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" autocomplete="off"></asp:TextBox> </td> </tr> <tr> <td class="auto-style6">&nbsp;</td> <td> <asp:Button ID="btnSubmitLogin" runat="server" OnClick="btnSubmitLogin_Click" Text="Login" /> </td> </tr> <tr> <td style="align-content:center"> <asp:Label ID="lblMessage" runat="server"></asp:Label> </td> </tr> </table> </asp:Content></nowiki></pre>

由cor-el于修改

所有回复 (2)

more options

Sorry, this isn't the best site for posting code... can you edit your question (there may be a link on the right side of it) and use pre tags around the code block? Also, please provide the code that is served to the browser (use right-click > View Page Source in Firefox), because we are not always familiar with how .Net code renders to the client.

More generally, Firefox ignores autocomplete="off" on username and password fields, according to:

https://developer.mozilla.org/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields

more options

I've placed the code in PRE tags (remember that this forum includes a separate DIV.content-raw with the raw code)


There is a pref (signon.storeWhenAutocompleteOff) that can be changed to make Firefox honor autocomplete="off", but you can't affect this via code in the website. The only way would be to code the form in such a way that Firefox doesn't recognize it as a login form, bit I don't know how to do this. We sometimes get a question where the Firefox Password Manager isn't triggered by the login form for some reason.