c# - ajax autocompleteextender method help needed -
i'm attempting add autocompleteextender form because have list of 100,000+ entries user choose from. using combobox, slow load.
problem i'm having in order populate list, parameters needed within method. method public static string. if 'hard-code' number parameters, works great. when reference field give me value, autocomplete feature doesn't work. if remove "static" method, can use parameters; autocomplete doesn't work.
how can correct or rewrite list available ace? appreciated, thanks!
[system.web.services.webmethodattribute(), system.web.script.services.scriptmethodattribute()] public static string[] getcompletionlist(string prefixtext, int count, string contextkey) {
the 2 lines below parameters datatable. here issue lies:
int userid = 1;//= convert.toint32(lbluserid.text); int rid = 1;//convert.toint32(lblrr.text); codebase code = new codebase(); datatable dt = newdatatable(); dt = code.getusercrossings(userid, rid); string[] main = new string[0]; (int = 0; < dt.rows.count - 1; i++) { if (dt.rows[i].itemarray[0].tostring().startswith(prefixtext)) { array.resize(ref main, main.length + 1); main[main.length - 1] = dt.rows[i].itemarray[0].tostring(); if (main.length == 40) break; } } array.sort(main); return main; }
Comments
Post a Comment