I have a asp.net/MVC/Razor project that the client has requested not save username and passwords. I've found multiple sites saying that autocomplete = "off" or autoCompleteType = "disable" should work, but they don't work for me in Chrome 42. I've seen sites that say autocomplete is in HTML5 and should work, but I've also seen sites that say it is NOT supported by modern browsers. My questions are:
Can someone give me a definitive answer on whether there is a way to block saving passwords in modern browsers? And, if there is, how to do that?
If this can't be done, can someone point me to a website that explains that this can't be done in modern browers? I don't want a stackoverflow comment or message board discussion; I need a definitive, clear, professional explanation that I can show to the client explaining why this can't be done in a simple way.
Here are a couple sites that seem to disagree with each other:
"IE11 dropped support for autocomplete=off for input type=password at both the form and element level." How to disable autocomplete for a HTML password field in IE11?
"HTML5 has an autocomplete attribute which can be specified as either on or off in a field." Autocomplete text input for HTML5?
Here is the code I've use with the autocomplete tags:
In the form:
@using (Html.BeginForm("Login", "Admin", FormMethod.Post, new { @autocomplete = "off", @autoCompleteType = "disable"}))
In the input tags:
@Html.TextBoxFor(m => m.UserName, new { @class = "span12", @autocomplete = "off", @autoCompleteType = "disable" })
@Html.PasswordFor(m => m.Password, new { @class = "span12", @autocomplete = "off", @autoCompleteType = "disable" })
I also tried enabling autocomplete through javascript:
$("input:text,form").attr("autocomplete", "off")
Also tried setting the text boxes to blanks, but the values still get populated by the browser:
$("#UserName").val("");
$("#Password").val("");