prevent文本框自动填充用previously输入的值 [英] Prevent textbox autofill with previously entered values

查看:146
本文介绍了prevent文本框自动填充用previously输入的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些TextBox控件ASP页面就可以了。

I have an asp page with some Textbox controls on it.

默认情况下,浏览器会提示每盒previously输入的值。

By default, the browser will suggest previously entered values for each box.

我想prevent这种行为对一些文本框。

I'd like to prevent that behavior for some of the textboxes.

有没有办法能够可靠地做到这一点在所有主要的浏览器?

Is there a way to reliably do that across all major browsers?

我试过设置

AutoCompleteType="Disabled"

但是,这似乎已经在Firefox没有效果。

But that seems to have no effect in Firefox.

下面是行为的一个形象,我想prevent。

Here is an image of the behavior I'm trying to prevent.

推荐答案

对于Firefox

或者:

<asp:TextBox id="Textbox1" runat="server" autocomplete="off"></asp:TextBox>

还是从codeBehind:

Or from the CodeBehind:

Textbox1.Attributes.Add("autocomplete", "off");

这篇关于prevent文本框自动填充用previously输入的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆