关于asp.net:如何防止浏览器缓存信用卡号字段

How to prevent the credit-card number field being cached by the browser

我在一个包含信用卡号的网页上有一个输入字段。防止浏览器缓存该值的最佳方法是什么?

任何解决方案都需要在多种浏览器上运行。


将属性autocomplete="off"放置到您的html表单中。例如

1
2
3
4
<form name="form1" id="form1" method="post" autocomplete="off"
  action="http://www.example.com/form.cgi">
[...]
</form>

请参阅此页面。


1
</asp:TextBox>