开发者

asp.net "auto complete" - populate with a special character

First of all, i'm using asp.net c#.

So i searched in many websites but i didnt find any solutions yet.

I use autocompleteextender from asp.net ajax extension. I want to populate specific data list in a textbox when i type开发者_运维知识库d a special character. For example; "When i type a specific character like "@" in a textbox, it should populate me from the db a specific data list".

Until the textbox has a character like "@" it should populated me some list. But i dont wanna populate it on the first word. After i have typed the character "@", it should populate me the list.

Is this possible with ajax auto complete extender? How? If not, How?

Thank you


As the AjaxControlToolkit is an open source project, you can download project sources and make all customization that you need. In this particular case enough to add very few changes: edit the AutoCompleteBehavior.pre.js file in AutoComplete folder of MicrosoftAjax.Extended project. You need following changes: in the _onTimerTick method change from

if (text.trim().length < this._minimumPrefixLength) {
            this._currentPrefix = null;
            this._update('', null, /* cacheResults */false);
            return;
        }

To

if (text.trim().length < this._minimumPrefixLength || text.indexOf('@') == -1) {
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜