Posted in Javascript onMay 10, 2010
包括POST,GET,AJAX
前台调用
jQuery.post("NewDoAjax.aspx", { max: ' N !', name: 'wsenmin' }, function(data) { alert(data) }); jQuery.get("NewDoAjax.aspx", { max: ' B !', name: 'wsenmin' }, function(data) { alert(data) }); var superMan = "max=I am jq &name= it is ajax "; jQuery.ajax({ type: "POST", url: "NewDoAjax.aspx", data: superMan, success: function(msg) {alert(msg);} });
C#代码:(将以下代码保存为NewDoAjax.aspx文件)
<%@ Page Language="C#" ValidateRequest="false" EnableSessionState="True"%> <%@ Import NameSpace="System.Data.SqlClient" %> <%@ Import NameSpace="System.Data" %> <%@ Import Namespace="System.Configuration"%> <%@ Import Namespace="System.Web.Security"%> <%@ Import Namespace="System.Drawing"%> <script type="text/C#" runat="server"> protected void Page_LoadComplete(object sender, EventArgs e) { Response.ClearContent(); Response.Clear(); string yy = null; int count = Request.Form.Count; int count2 = Request.QueryString.Count; foreach (var cv in Request.Form) { yy += cv + ":"+Request.Form[cv.ToString()].ToString()+" 哈好简单|| "; } foreach (var cv in Request.QueryString) { yy += cv + ":" + Request.QueryString[cv.ToString()].ToString() + " 好简单哇哈|| "; } Response.Write(yy.Substring(0,yy.Length-4)); Response.End(); } </script>
超简单的jquery的AJAX用法
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@