I am designing a simple asp:TextBox, but the input may contain sensitive data. How can I prevent the textbox from displaying previous values entered?
Asked
Active
Viewed 66 times
0
-
1Have you tried adding autocomplete=off to the form? – Anon Coward Jul 13 '16 at 16:11
-
I saw a similar question suggest that, but AutoComplete is not available for asp:TextBox. There is AutoCompleteType, but it doesn't appear to be the same thing. – Anagins Jul 13 '16 at 16:13
-
1You can take a look at this post: http://stackoverflow.com/questions/9686224/prevent-textbox-autofill-with-previously-entered-values. According to the accepted answer, the `autocomplete` attribute can be set in code-behind. – ConnorsFan Jul 13 '16 at 16:16
-
Thank you for the link - it worked. Is there any reason the intellisense didn't recognize AutoComplete as a valid field? – Anagins Jul 13 '16 at 16:20
-
The ASP.NET probably does not implement that attribute of the underlying HTML element. When that happens, you can add the attribute "by hand" to the `Attributes` collection of the control. – ConnorsFan Jul 13 '16 at 16:38