“自动完成关闭”无法在IE中运行 - ASP.Net

时间:2021-05-08 03:18:05

Question: Is there any reason Autocomplete=off on a ASP:Textbox would not be working in IE 7?

问题:ASP上是否有任何原因Autocomplete = off:文本框在IE 7中不起作用?

In case this is the best term for it, the IE Autocomplete feature is that drop down list like thing that drops down from textboxes and shows you past things you have typed in.

如果这是它的最佳术语,IE自动完成功能就是下拉列表,就像从文本框中删除的内容,并显示您输入的所有内容。

I need the IE Autocomplete feature to not work at this point for a textbox that is part of a user control that works like an Ajax Autocomplete control. Problem is, when the Ajax Autocomplete selection list shows up, so does the IE Autocomplete selection box. (In cases where I might double click the textbox) I'm using this:

我需要IE自动完成功能,此时不能用于文本框,该文本框是用户控件的一部分,其工作方式类似于Ajax自动完成控件。问题是,当Ajax自动填充选择列表出现时,IE自动填充选择框也会出现。 (如果我可能双击文本框)我正在使用这个:

someTextbox.AutoCompleteType = AutoCompleteType.Disabled;

But it stills shows up. I've tried removing the items from the IE Autocomplete, but the next time I type something in and press enter, the problem reappears. Any ideas?

但它仍然显示出来。我尝试从IE自动完成功能中删除项目,但下次输入内容并按回车键时,问题会重新出现。有任何想法吗?

Note: The textbox is rendered with the Autocomplete=off tag when viewing the source.

注意:查看源时,文本框将使用Autocomplete = off标记进行渲染。

Note 2: Have tried someTextbox.Attributes.Add("autocomplete", "off"); also without success

注2:尝试过someTextbox.Attributes.Add(“autocomplete”,“off”);也没有成功

* Update, figured it out a while ago but forgot *

*更新,不久之前想出来但忘了*

test.AutoCompleteType = AutoCompleteType.None;

That actually works. I'm not sure what the difference is though. Suppose Ill look that up sometime.

这确实有效。我不确定有什么区别。假设我看起来有时候。

4 个解决方案

#1


6  

Try adding AUTOCOMPLETE="off" to your form tag too:

尝试将AUTOCOMPLETE =“off”添加到您的表单标记中:

<form name="form1" id="form1" method="post" autocomplete="off">

#2


6  

Trying to clear out my unanswered questions that I've answered in the original post.

试图清除我在原帖中回答的未回答的问题。

test.AutoCompleteType = AutoCompleteType.None;

#3


1  

Try this one:

试试这个:

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

#4


1  

in Page Load

在页面加载

txtusername.AutoCompleteType = AutoCompleteType.Disabled;

#1


6  

Try adding AUTOCOMPLETE="off" to your form tag too:

尝试将AUTOCOMPLETE =“off”添加到您的表单标记中:

<form name="form1" id="form1" method="post" autocomplete="off">

#2


6  

Trying to clear out my unanswered questions that I've answered in the original post.

试图清除我在原帖中回答的未回答的问题。

test.AutoCompleteType = AutoCompleteType.None;

#3


1  

Try this one:

试试这个:

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

#4


1  

in Page Load

在页面加载

txtusername.AutoCompleteType = AutoCompleteType.Disabled;