Page_Load 和 XmlHttp 问题 例子参考http://dotnet.aspx.cc/article/4ae836f8-ccb4-4bef-90b1-25bb1a5e6433/read.aspx 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 脚本 引用了prototype.js //提交数据 var url = '/CMail/Vote/RCP/RCP_AddVote.aspx?action=add&f='+Math.random(); var myAjax = new Ajax.Request( url, { method: 'post', postBody: xml, onComplete: showResponse, onCreate: showLoading, asynchronous:true }); function showResponse(originalRequest) { Element.hide('spanDataLoding'); if(originalRequest.responseText=="-1") { alert("未登录,或已超时!"); } } function showLoading() { Element.show('spanDataLoding'); } public partial class RCP_AddVote : ICS.SmsDisk.Base.CMailPageBase { private XmlDocument xmlDoc = null; protected void Page_Load(object sender, EventArgs e) { if (!this.IsPower) { Response.Write("-1"); return; }cs文件 //System.Threading.Thread.Sleep(2000); getPostData(HttpContext.Current); if (Request["action"] != null && Request["action"].ToString().ToLower() == "add") { AddDate(); } } 脚本 引用了prototype.js //提交数据 var url = '/CMail/Vote/RCP/RCP_AddVote.aspx?action=add&f='+Math.random(); var myAjax = new Ajax.Request( url, { method: 'post', postBody: xml, onComplete: showResponse, onCreate: showLoading, asynchronous:true }); function showResponse(originalRequest) { Element.hide('spanDataLoding'); if(originalRequest.responseText== "-1 ") { alert( "未登录,或已超时! "); } } function showLoading() { Element.show('spanDataLoding'); } cs文件 public partial class RCP_AddVote : ICS.SmsDisk.Base.CMailPageBase { private XmlDocument xmlDoc = null; protected void Page_Load(object sender, EventArgs e) { if (!this.IsPower) { Response.Write( "-1 "); return; } //System.Threading.Thread.Sleep(2000); getPostData(HttpContext.Current); if (Request[ "action "] != null && Request[ "action "].ToString().ToLower() == "add ") { AddDate(); } } 自己结贴 if(originalRequest.responseText== "-1 ") { alert( "未登录,或已超时! "); } 引发错误 动态连接库DLL的调用问题 分割字符串 别人给我的留言,请天使们猜猜看 【求助】C# 打印窗体 如何做到真正打印form窗体内容 未将对象引用设置到对象的实例 C#构造函数和析构函数 Vs2013发布 一个小问题,大家来看下 非高手莫进,请问如何在两个应用程序之间转递数据! 想在家赚美元的进来,我并非善良到有钱自己不赚让别人赚,而是老外的钱,不赚白不赚,大家一起赚嘛。只有一个要求,赚到钱的给我发封信, 【200分】一个游戏辅助工具,计算两点之间距离,请大家帮忙。帮顶有分啊 C#的两种数据类型转换有有区别?
//提交数据
var url = '/CMail/Vote/RCP/RCP_AddVote.aspx?action=add&f='+Math.random();
var myAjax = new Ajax.Request(
url,
{
method: 'post',
postBody: xml,
onComplete: showResponse,
onCreate: showLoading,
asynchronous:true
});
function showResponse(originalRequest)
{
Element.hide('spanDataLoding');
if(originalRequest.responseText=="-1")
{
alert("未登录,或已超时!");
}
}
function showLoading()
{
Element.show('spanDataLoding');
} public partial class RCP_AddVote : ICS.SmsDisk.Base.CMailPageBase
{
private XmlDocument xmlDoc = null; protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPower)
{
Response.Write("-1");
return;
}cs文件 //System.Threading.Thread.Sleep(2000);
getPostData(HttpContext.Current);
if (Request["action"] != null && Request["action"].ToString().ToLower() == "add")
{
AddDate();
} }
//提交数据
var url = '/CMail/Vote/RCP/RCP_AddVote.aspx?action=add&f='+Math.random();
var myAjax = new Ajax.Request(
url,
{
method: 'post',
postBody: xml,
onComplete: showResponse,
onCreate: showLoading,
asynchronous:true
});
function showResponse(originalRequest)
{
Element.hide('spanDataLoding');
if(originalRequest.responseText== "-1 ")
{
alert( "未登录,或已超时! ");
}
}
function showLoading()
{
Element.show('spanDataLoding');
}
cs文件 public partial class RCP_AddVote : ICS.SmsDisk.Base.CMailPageBase
{
private XmlDocument xmlDoc = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPower)
{
Response.Write( "-1 ");
return;
}
//System.Threading.Thread.Sleep(2000);
getPostData(HttpContext.Current);
if (Request[ "action "] != null && Request[ "action "].ToString().ToLower() == "add ")
{
AddDate();
}
}
if(originalRequest.responseText== "-1 ")
{
alert( "未登录,或已超时! ");
}
引发错误