前台JQuery方式的Ajax代码:

<script type="text/javascript"> $(function () { $("#btnAddNews").bind("click", function () { var title = $.trim($("#txtNewTitle").val()); var content = $("#<%=fckNewsContent.ClientID %>").val(); $.ajax({ type: "POST", url: "AddNews.aspx/addNew", data: "{'title':'" + title + "','content':'" + content + "'}", contentType: "application/json;charset=utf-8", dataType: "json", success: function (data) { alert(data.d); }, error: function (err) { alert(err); } }); }); }); </script>
后台demo.aspx.cs的代码:

[WebMethod] public static string addNew(string title, string content) { return title + content; }