页面跳转无效的问题,请出现过类似情况的速来帮忙。谢谢
本程序用了Extjs,ajax.等技术。想实现的功能,就是在Session消失的时候跳转到指定页面。
在default前台页面中加载了ext的js文件,和许多个人写的js
代码展示:
--------------------编程问答-------------------- 异常是什么 --------------------编程问答-------------------- 出现的异常如下
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserID"] == null || Session["UserID"].ToString() == "")
{
Response.Redirect("Login.aspx"); //此代码的跳转语句执行后无效,会出现异常。
//Response.Redirect("Login.aspx",false); //如果改成这种方式不会出现异常,语句正常执行,但是仍然无跳转效果
return;
}
//Session["UserID"] = "admin";
AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));
AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxProServer));
if (Request.Params["start"] != null && Request.Params["limit"] != null)
{
string type = Request.Params["type"].ToString();
if (type =="user")
{
GetAllUserInfo();
}
else if (type == "role")
{
GetAllRoleInfo();
}
else if(type=="task")
{
string taskType = Request.Params["taskType"].ToString();
GetTaskInfoByState(taskType);
}
else if (type == "Note")
{
string xxzt = Request.Params["xxzt"].ToString();
GetNoteInfo(xxzt);
}
else if (type == "SearchNote")
{
string listvaule = Request.Params["listvaule"].ToString();
string searchtxt = Request.Params["searchtxt"].ToString();
string szt = Request.Params["szt"].ToString();
SearchNoteInfo(listvaule, searchtxt, szt);
}
else if (type == "TaskSearch")
{
GetAllUserInfo();
}
else if (type == "NewNote")
{
GetNewNoteInfo();
}
}
}
“
由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值。
” --------------------编程问答-------------------- 参考 --------------------编程问答--------------------
--------------------编程问答-------------------- 用Response.Redirec 是有这种情况,以前遇到过,不过现在基本不用Response.Redirec跳转了
Response.Redirect ("XXX.aspx", false);
这样应该可以,楼主试试.....
补充:.NET技术 , ASP.NET