var mm = WebSAP.BLL.OCRD.GetList("CardCode = " + document.all.CardCode.value + "").value;
//GetList是一个DataTable来的.(用了Ajax来做)
我想邦定下拉框怎么邦定?其中下拉框的id = CntctPrsn ; 
试了一下这样,但是不行.
document.all.CntctPrsn =mm.rows[0]["cntctprsn"] ;
请各位大哥解答一下,在线等

解决方案 »

  1.   

    this.ddlPCatalog.DataSource = dt.DefaultView;
      this.ddlPCatalog.DataTextField = "CatalogName";
      this.ddlPCatalog.DataValueField = "CatalogId";  this.ddlPCatalog.DataBind();
      

  2.   

    试试mm.rows[0].cntctprsn
    for(var i=0; i<mm.Rows.length;; i++)
         {
         var name=ds.Tables[0].Rows[i].cntctprsn;
           var id=ds.Tables[0].Rows[i].cntctprsn;
           document.all("DropDownList2").options.add(new Option(name,id));
         }
      

  3.   

    var ds = response.value;
        if(ds!=null && typeof(ds)=="object"&& ds.Tables!=null)
        {
            for(var i=0;i<ds.Tables[0].Rows.length;i++)
            {
                var id = ds.Tables[0].Rows[i].USERID;
                var name = ds.Tables[0].Rows[i].USERNAME; 
                document.getElementById("DropDownList2").options.add(new Option(name,id));
            }
        }
      

  4.   

    回:sunjay117(sunjay117)
    脚本出错.
    rows不是对象或为空
      

  5.   

    var mm = GetList("").value;
    //GetList是一个DataTable来的.(用了Ajax来做)
    我想邦定下拉框怎么邦定?其中下拉框的id = CntctPrsn ; 
    试了一下这样,但是不行.
    document.all.CntctPrsn =mm.rows[0]["cntctprsn"] ;
    总是提示rows[0]为空或不是对象
    请各位大哥解答一下,在线等