87,907
社区成员
发帖
与我相关
我的任务
分享
function abcd() {
try {
$.ajax({
url: "../../Handlers/Handler1.ashx?rn=" + GetRandomNum(10),
type: "POST",
dataType: "json",
async: true,
data: {
canshu: "LXX"
},
//traditional: true,
success: function (data, status) {
if (data) {
var ab = data;
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
ShowErrMsg("errMsg", textStatus, true);
}
});
} catch (e) {
alert(e.message);
}
}
<body onload="abcd();" style="overflow:hidden;"><%--GetPageSize();--%>
<form id="form1" runat="server">
<div class="divMainBody">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
namespace TerminalManageSystem.Handlers
{
/// <summary>
/// Handler1 的摘要说明
/// </summary>
public class Handler1 : IHttpHandler, IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string abc = context.Request["canshu"];
context.Response.Write("Hello World");
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
<sessionState mode="StateServer" cookieless="false" timeout="540" />