我请别人外包做了个网站,用.net2.0开发,对下拉连动采用的是AJAX的处理办法,现在外包的兄弟出国了,我在我的另一个程序中准备采用这中处理方式,但出了点问题,具体是这样的,在BIN下有AJAX.dll文件。
在test.aspx.cs中源码如下:
Ajax.Utility.RegisterTypeForAjax(typeof(Product));
if (!Page.IsPostBack)
{
this.DropDownList1.DataSource = Product.GetBigSortList();
this.DropDownList1.DataTextField = "sProBigName";
this.DropDownList1.DataValueField = "iProBigSort_ID";
this.DropDownList1.DataBind();
this.DropDownList1.Attributes.Add("onclick", "BigSortResult();");
在test.aspx中引用对象product:
<SCRIPT language="javascript" type="text/javascript">
function BigSortResult()
{
var BigSort=document.getElementById("DropDownList1");
Product.GetSamllSortList(BigSort.value,Get_BigSort);
}
</SCRIPT>
系统提示Product没定义,我检查了,所有做法一样,但他的程序中没问题,
请问是不是还有什么地方没设置好?
web.config中加入
<system.web>
...
...
<httpHandlers>
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
</httpHandlers>