How to clear the cache in TextBox in ASP.NET MVC

How to clear the cache in TextBox in ASP.NET MVC


We don't want to see the cache in the input in ASP.NET MVC as shown below.


ClearAllFieldInASPNET_1.png

We have a page which accepted an user name and a password


When we try the autocomplete="off" attribute as below, the cache is cleaed successfully.


ClearAllFieldInASPNET_2.png

How to disable autocomplete in ASP.NET MVC


Turn off the autocomplete.

	@Html.TextBoxFor(m => m.UserName, new { @class = "form-control floating", autocomplete = "off" })

It will generate markup that is close to the following.


	<input autocomplete="off" class="form-control floating" data-val="true" id="UserName" name="UserName" type="text" value="">

tag : ASP.NET MVC autocomplete="off"