问题描述
如题:此回调函数,回调客户端的vaule
functionCallServer(input,context){context.length=0;arg=input.value;<%=ClientScriptManager.GetCallbackEventReference(this,"arg","receiveServerData","context")%>}请问:能同时回调客户端dropdownlist的item值吗?同时ReceiveServerData(result,context)怎么修改
functionReceiveServerData(result,context){context.length=0;vararrData=result.split(",");for(vari=0;i<arrData.length;i++){vardata=arrData[i].split("@");context.options[context.length]=newOption(data[1],data[0]);}}
解决方案
解决方案二:
顶一下
解决方案三:
顶
解决方案四:
up
解决方案五:
在线等,急!!!!!!
解决方案六:
<scripttype="text/javascript">varoHttpReq,oDoc,result;functioncreateXMLRequest(){if(window.ActiveXObject){//判断当前浏览器是不是ie,oHttpReq=newActiveXObject("Microsoft.XMLHTTP");}else{//不是ieoHttpReq=newXMLHttpRequest();}}functionload(ddlname,bids){vardrp2=document.getElementById(ddlname);drp2.length=0;createXMLRequest();oHttpReq.onreadystatechange=handleStateChange;oHttpReq.open("GET","GetDatatoddlcenter.aspx?"+ddlname+"="+bids,false);oHttpReq.send(null);//varresult=oHttpReq.responseText;varkinds=result.split(';');//对返回的数据进行处理for(i=0;i<kinds.length-1;i++){oid=kinds[i].split(',')[0];//获取ddlcenter类的datavaluefield值oname=kinds[i].split(',')[1];//获取cname小类的datatextfield的值varnewOption=newOption(oname,oid);eval(drp2.options[i]=newOption);//绑定到ddlcenter,作为单个节点选项}}functionhandleStateChange(){//f服务器端执行,回调函数if(oHttpReq.readyState==4)//成功加载{if(oHttpReq.status==200)//ok{result=oHttpReq.responseText;}}}
解决方案七:
调试中,谢谢xierfly!!