Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set autocomplete=off globally for ASP.NET application?

We have a mature application which handles sensitive data and has grown to several hundred pages and controls. It is now a requirement to set autocomplete=off for all the forms and textboxes in the entire application. I don't believe there is a global web.config setting that would do this, so what would be the best way? My initial thought was to use a PageBase class (which all pages inherit from) to dynamically find all Form and TextBox controls and dynamically add the attribute autocomplete="off". Does this seem reasonable or is there a better way? Thanks for any recommendations.

like image 440
Solid Performer Avatar asked Dec 23 '11 15:12

Solid Performer


People also ask

How do I turn off autocomplete?

At the top right, tap your Profile picture or initial. Settings. General. Turn off Autocomplete with trending searches.

How do I turn off input box suggestions?

Click the Display tab. Do one of the following: To enable AutoComplete for the text box, select the Enable AutoComplete check box. To disable AutoComplete for the text box, clear the Enable AutoComplete check box.


1 Answers

If all your pages have master page then try to disable autocomplete for input controls using Jquery in the master page.

You can place the below code in the master page

$(document).ready(function () { $("input").attr("autocomplete", "off"); }); 
like image 170
Pavan Avatar answered Oct 12 '22 09:10

Pavan