后台:
public class Demo : Page
{
protected System.Web.UI.WebControls.DropDownList goodsType;
protected System.Web.UI.WebControls.DropDownList pptype;

private void Page_Load(object sender, System.EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(Demo));
if(!this.IsPostBack)
{
    goodsType.DataSource = bindData();
goodsType.DataTextField = "GoodsTypeName";
goodsType.DataValueField ="GoodsType_ID";
goodsType.DataBind();
goodsType.Items.Insert(0,new ListItem("--please select item --"));
//事件
goodsType.Attributes.Add("onclick","loadPP(this);");
}
}
public DataTable bindData()
{
   SqlConnection conn = new SqlConnection("server=.;database=cvbbs; uid=sa;pwd=");
   conn.Open();
   SqlDataAdapter da = new SqlDataAdapter("select * from D_GoodsTypeInfo",conn);
   DataTable dt = new DataTable();
   da.Fill(dt);
   return dt;
}
[Ajax.AjaxMethod()]
public DataSet getPP(int goodsTypeID)
{
//string str ="select * from D_PP where GoodsType_ID = "+goodsTypeID;
SqlConnection conn = new SqlConnection("server=.;database=cvbbs; uid=sa;pwd=");
conn.Open();
SqlCommand  cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText ="p_GoodsTypeGetPP";
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.Parameters.Add("@GoodsID",goodsTypeID);
DataSet ds = new DataSet();
da.Fill(ds);
return ds;
}++++++++++++++++++++++++++++++++++
后台
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:DropDownList id="goodsType" style="Z-INDEX: 101; LEFT: 216px; POSITION: absolute; TOP: 88px"
runat="server" Width="184px"></asp:DropDownList>
<asp:DropDownList id="pptype" style="Z-INDEX: 102; LEFT: 536px; POSITION: absolute; TOP: 96px" runat="server"></asp:DropDownList></form>
<script language="javascript">
<!--
         var pptypelist = document.getElementById("<%=pptype.ClientID%>");
         
         function loadPP(object)
         {
             var goodsID =  document.getElementById("goodsType").value;//goodsType.options[goodsType.selectedIndex].value;
             if(goodsID >0)
             {
                 Demo.getPP(goodsID,loadPP_CallBack);
             }
             else
             {
              pptypelist.options.length = 0;
             }
         }
         //callback we told Ajax.Net to pass the response tos
         function loadPP_CallBack(response)
         {
            if(response.error != null)
            {
               alert(response.error); //we should probably do better than this
   return;
            }
            var ds = response.value;
if(ds == null || typeof(ds) !="object")
{
return;
}
pptypelist.options.length = 0;
for (var i = 0; i < ds.Tables[0].Rows.length; ++i)
{
//pptypelist.options[pptypelist.options.length] = new Option(ds.Tables[0].Rows[i].PPName, ds.Rows[i].PPID);  
var name = ds.Tables[0].Rows[i].PPName;
var ID = ds.Tables[0].Rows[i].PPID;
document.getElementById("pptype").options.add(new Option(name,ID));     

         }
         
         
//-->
</script>
我现在出现的问题是,点击goodsType  下拉列表的时候,第二个控件没有数据载入,但是确实有数据可以加载。请问是问什么