#2
foshan2007-10-15 11:43
|
如何将从WebService中传送过来的DataTable赋值给AJAX客户端Select控件?(从WebService中传送过来的DataTable是正确的,但不知为何不能绑定到客户端Select控件?)
var MySelect2;
function pageLoad()
{
MySelect2=new Sys.Preview.UI.Selector($get( 'Select2 '));
MySelect2.initialize();
MySelect2.set_textProperty("ChaXunXiangMu_Name");
MySelect2.set_valueProperty("ChaXunXiangMu_ID");
ChaXunXiangMuWebService.GetDataSet(GetDataSet_onSucceeded, onFailed);
}
function GetDataSet_onSucceeded(result)
{
MySelect2.set_data(result);
MySelect2.dataBind();
}
---------------------------
WebService 文件:
[WebMethod]
public DataTable GetDataSet()
{
DataSet ds = new DataSet();
ds = ChaXunTiaoJian.GetChaXunXiangMu();
return ds.Tables[0];
}
[此贴子已经被作者于2007-10-12 10:12:34编辑过]