开发者

ASP.Net TextBox.AutoCompleteType property - useful? customizable?

The ASP.Net TextBox control has an AutoCompleteType property that takes an AutoCompleteType enumeration value.

First, is this property commonly used in actual development? Or is "browser autocomplete" turned off and 开发者_如何转开发Ajax autocomplete used instead?

Second, are you constrained to only the values in the AutoCompleteType enum? Can you extend the AutoCompleteType enum to contain custom values?


The AutoCompleteType enum is merely a simple way of referencing the autocomplete expando attribute exposed by the html tag. This attribute can be any string, with "off" being reserved for disabling the feature. Any textboxes that use a specific string will start autocompleting from the same shared list of previous entries.

For example: If you set autocomplete on 2 boxes to "car", the next time you visit a form with another box with autocomplete set to "car" your previously used choices will become available.


Setting autocompletetype="disabled" didn't actually turn off auto complete in Firefox. The only time autocompletetype works is when the client is using IE. (Yay asp.net browser sniffing.)

Using the non-standard attribute autocomplete="off" works -- and you can use this in your markup instead of using setattribute().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜