我想知道为什么 IsPostBack 总是给我错误并且无法从 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();
}
}
}
很简单,我只想在 JS 调用时从 handle.aspx 返回一个字符串
谢谢