c# - How to autocomplete in ASPX with original page request only? -
We are developing an ASPX (.NET 2.0) page that contains a selection list with lots of elements (200 ++)
We need autocomplete to make it in such a situation that behaves like a text box, but with autocomplete suggestions.
We want to use JQuery so far our search has changed only auto-complexes, which require some kind of back end service, additional requests (AJAX) etc. We would like to distribute all requests once with the page request. Ideally this selection list will be in the form of entries.
Are there autocomplete boxes that change a selection list? Or is there a way to automatically auto-complete the data on the page (in .net 2.0 in ASPX) on a page, so that there is no need to access external resources?
EDIT: Postback I'm looking for I mean the original page has been given with the request. Edit 2: The page should be clamped in a lot of solutions, so many solutions 'inject', so without JavaScript you have no content, this can be 200+ options, but less At least they will be present there This is why conversion of a select list is our ideal.
Use suggestions suggested by Steve Wilcock. Output a regular selection box, then replace it with a text box in your script and initialize the plug-in with an array, which you create with the options-elements. Then select your ... and you can change it like this: ... there is no JS? No problem - you still have your data :
& lt; Choose shape = "1" id = "option" name = "option" & gt; Comes as. & Lt; Options & gt; Option # 1 & lt; / Options & gt; & Lt; Options & gt; Option # 2 & lt; / Options & gt; & Lt; Options & gt; Option # 3 & lt; / Options & gt; & Lt; Options & gt; Option # 4 & lt; / Options & gt; & Lt; Options & gt; Option # 5 & lt; / Options & gt; & Lt; Options & gt; Option # 6 & lt; / Options & gt; & Lt; Options & gt; Option # 7 & lt; / Options & gt; & Lt; / Select & gt;
$ (function () {// execute once the dOM is ready ... // Create an arc of options text var option = []; $ ("# option option"). (Function () {options.push ($ (this) .text ());}); // Select an input field, select it with, replace // and replace the autocomplete wire. $ ("& Lt; input id = 'option' name = 'option' type = 'text' & gt; ; ") .replaceAll (" # options "). Autocomplete (options, {AutoFill: true});}); select .
Comments
Post a Comment