62,046
社区成员
发帖
与我相关
我的任务
分享
public class GetData : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string strType = context.Request["Type"];
string strReturn = "1";
if (strType == "basDept") //通过类别去推荐商品
{
strReturn = ShopProduct(context);
}
if (strType == "GetDept") //通过一级类别取二级
{
strReturn = GetDept(context);
}
context.Response.Write(strReturn);
}
}
ASHX 这样就接收到 AJAX 传的值了