0

We are migrating a existing asp.net application without master pages to a new one with master pages.

Old Code:

<form id="Form1" method="post" runat="server" autocomplete="off">

When using master pages how will we put autocomplete="off" in ContentPlaceHolder? can we use

<asp:Content ID="Content1" ContentPlaceHolderID="ContentArea" runat="server" autocomplete="false">
  • 1
    You can set that attribute on 'form' element that is on the master page or if you want to set it for particular page only you can do it in code-behind by adding attribute to form element calling: this.Form.Attributes.add("autocomplete", "off") – PrzemG Sep 15 '14 at 10:07
  • Possible duplicate? [How to set autocomplete=off globally for ASP.NET application?](http://stackoverflow.com/questions/8617806/how-to-set-autocomplete-off-globally-for-asp-net-application) – Izzy Sep 15 '14 at 10:08

2 Answers2

1

If you want to disable it globally you should use jQuery:

$(document).ready(function () { $("input").attr("autocomplete", "off"); }); 
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
PieterSchool
  • 499
  • 4
  • 15
0

Add autocomplete="off" to Site.Master's Form tag.

Like this...

<form id="MasterForm" runat="server"  autocomplete="off">
HATCHA
  • 600
  • 1
  • 8
  • 15