Rough version:
Code
Function reload () {SYS. webforms. pagerequestmanager. getinstance (). add_endrequest (initpage );}
Function initpage (){
VaR JSON = getjson ();
VaR DATA = eval ('+ JSON + ')');
$ ('# <% = Txtaudit. clientid %>'). AutoComplete (data ,{
Width: 150,
MAX: 50,
Minchars: 1,
Cachelength: 20,
Delay: 150,
Matchcontains: True,
AutoFill: false,
Scrollheight: 300,
Formatitem: function (row, I, max ){
Return row. Name;
},
// Formatmatch: function (row, I, max ){
// Var TXT =. Val ();
// Return itemcheck (row, txt );
//},
Formatresult: function (ROW ){
Return row. employeename;
}
}). Result (function (event, item ){
VaR auditid =$ ('# <% = hauditid. clientid %> ');
Auditid. Val (item. ID );
});
Data = NULL;
}
Function getjson (){
VaR res;
$. Ajax ({
Async: false,
Type: "Post", // WebService access request using post
Contenttype: "application/JSON", // WebService returns the JSON type
URL: "../WebService. asmx/getemployeelist", // address and method name combination of WebService call ---- wsurl/method name
Data: "{}", // here is the parameter to be passed, in the format of data: "{paraname: paravalue}", as shown below
Datatype: 'json ',
Success: function (result ){
Res = result. D;
},
Error: function (result, status) {// if no above capture error occurs, the callback function here will be executed
If (status = 'error '){
Alert ("error:" + result );
}
}
});
Return res;
}
$ (). Ready (function (){
Reload ();
Initpage ();
});
A new version will be created after the upgrade.