我在想,为什么IsPostBack总是让我失败,并且无法从Request.QueryString获取值。我错过了代码的任何部分?IsPostBack始终= false,request.QueryString为空
我的JS
function BtnCal()
{
$.post(missingkids_handler,
{"Action":"MainAct", "SubAction":"SubAct"},
function(response)
{
var rtnObj = response.Data;
alert(rtnObj);
$("#retnTxt").html(rtnObj);
}, "json");
}
我处理aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["Action"] != "" && Request.QueryString["Action"] == "MainAct")
{
if (Request.QueryString["SubAction"] == "SubAct")
{
Response.Clear();
Response.Write("Hello Here");
Response.End();
}
}
}
很简单,我只是想从handle.aspx返回一个字符串,而JS调用
感谢
为此目的使用.asmx web服务不是更好吗? – whyleee