日期:2014-05-17 浏览次数:20657 次
/// <summary>
/// ProductHandler 的摘要说明
/// </summary>
public class ProductHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/xml";
string PCid = context.Request["ID"];
DataSet ProClass = Business.BLL_Product.getProductClassByID(PCid);
// ProClass.WriteXml(context.Response.Output);
context.Response.Write(ProClass.GetXml());
}
public bool IsReusable
{
get
{
return false;
}
}
}
<script type="text/ecmascript">
$(function () {
$('a').click(function () {
$('.children').css('display', 'none');
$(this).next('.children').css('display', 'block');
var Pid = $(this).attr('id');
$.post("ProductHandler.ashx", { "ID": Pid }, function (xhr) {
var items = xhr.firstChild;
items = $(items);
var str = "";
for (var i = 0; i < items[0].childNodes.length; i++) {
var ID = $(items[0].childNodes[i]).find("ID").text();
&nbs