日期:2014-05-16 浏览次数:20747 次
<script type="text/javascript"> $(document).ready(function () { $("p").click(function () { $.post("ashx/test.ashx", function (data, status) { var comments = $.parseJSON(data); for (var i = 0; i < comments.length; i++) { var comment = comments[i]; var book = $("<p>正题名:" + comment.ztm + "</p><br/><p>内容简介:" + comment.nrjj + "</p>"); $("#k").append(book); } }); }); }) </script>
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; BookTest bt = new BookTest(); List<BookTest> list = new List<BookTest>(); bt.Nrjj = "发改委成立至今只做过两件事:1、涨价,2、替涨价辩护."; bt.Ztm = "中国"; list.Add(bt); JavaScriptSerializer jss = new JavaScriptSerializer(); string data = jss.Serialize(list); context.Response.Write(data); } public bool IsReusable { get { return false; } }