Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
634 views
in Technique[技术] by (71.8m points)

internet explorer - "Autocomplete off" not working in IE - ASP.Net

Question: Is there any reason Autocomplete=off on a ASP:Textbox would not be working in 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.

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:

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?

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

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

* 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...