-1

How do I disable autocomplete in all my webpages without writing any code into page.

I need to know if there is any way of setting autocomlete to off in web.config.

Vishal Patel
  • 41
  • 4
  • 9
  • I am specifically asking - how to achieve this using web.config. – Vishal Patel Feb 06 '15 at 11:57
  • @Ariston, Seem you don't understand my question. so only you are marking this one as duplicate. – Vishal Patel Feb 06 '15 at 12:23
  • 1
    Its not possible to make it on web.config. – Aristos Feb 06 '15 at 14:17
  • 1
    Other possible way is to make custom form control and there to rewrite the form https://msdn.microsoft.com/en-us/library/system.web.ui.adapters.controladapter(v=vs.110).aspx Still need some code, only web.config can not work – Aristos Feb 06 '15 at 14:20

1 Answers1

2

Place the below code in your master page (if you have one):

$(document).ready(function () { $("input").attr("autocomplete", "off"); }); 

If you don't have one, put on every page.

There is no way to do that in web.config.

Izzy
  • 6,740
  • 7
  • 40
  • 84
Arthur Castro
  • 610
  • 6
  • 18
  • This answer is not what my question is looking for. I am specifically asking use only web.config. - No other place i should write code. – Vishal Patel Feb 06 '15 at 12:34
  • 3
    @VishalPatel this can't be done by the web.config, Arthur Castro his code is the easiest to use just use a master page and include that line just once to turn off the auto complete in every page (that's using th emaster page of course) – Owain van Brakel Feb 06 '15 at 13:06
  • 1
    @VishalPatel I answered your question. **Question:** "I need to know if there is any way of setting autocomlete to off in web.config." **Answer:** "There is no way to do that in web.config." _And gave another way to achieve that._ – Arthur Castro Feb 06 '15 at 15:26