![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
Disable Save Password Prompt in firefox (v.61) from aspx (autocomplete="off" not working)
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"> </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>
Geändert am
Alle Antworten (2)
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:
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.