救命啊,这response.redirect是咋回事啊

zhangshuang555 2011-09-09 04:32:14

异常:由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值

代码
protected void imgBtnRegister_Click(object sender, ImageClickEventArgs e)
{

try
{


if (Request.QueryString["CPJC_UserName"] == null)
{
Response.Redirect("SuccessMes.aspx?Email=" + this.txtEmail.Text.Trim());

}
else
{
//执行其他 }
}
catch (Exception ex)
{
Response.Write("请仔细检查后在注册,系统繁忙,请稍后重试。。。");
}

}

我断点调试,报出这样的错误!求救啊!
...全文
55 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
posefooler 2011-09-09
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 taomanman 的回复:]

C# code

protected void imgBtnRegister_Click(object sender, ImageClickEventArgs e)
{
try
{
if (!string.IsNullOrEmpty(Request.QueryString["CPJC_UserName"]))
{
……
[/Quote]

蝶恋花雨 2011-09-09
  • 打赏
  • 举报
回复
Response.Redirect("SuccessMes.aspx?Email="+this.txtEmail.Text.Trim()+"");

Page.ClientScript.RegisterStartupScript(this.GetType(), "", "window.locationhref='SuccessMes.aspx?Email=" + this.txtEmail.Text.Trim() + "'");
暖枫无敌 2011-09-09
  • 打赏
  • 举报
回复

protected void imgBtnRegister_Click(object sender, ImageClickEventArgs e)
{
try
{
if (!string.IsNullOrEmpty(Request.QueryString["CPJC_UserName"]))
{
Response.Redirect("SuccessMes.aspx?Email='" + this.txtEmail.Text.Trim()+"'");
}
else
{
//执行其他
}
}
catch (Exception ex)
{
Response.Write("请仔细检查后在注册,系统繁忙,请稍后重试。。。");
}
}
暖枫无敌 2011-09-09
  • 打赏
  • 举报
回复
清理一下,然后重新生成一下。


protected void imgBtnRegister_Click(object sender, ImageClickEventArgs e)
{
try
{
if (!string.IsNullOrEmpty(Request.QueryString["CPJC_UserName"]))
{
Response.Redirect("SuccessMes.aspx?Email=" + this.txtEmail.Text.Trim());
}
else
{
//执行其他
}
}
catch (Exception ex)
{
Response.Write("请仔细检查后在注册,系统繁忙,请稍后重试。。。");
}

}
  • 打赏
  • 举报
回复
Response.Redirect("SuccessMes.aspx?Email=" + this.txtEmail.Text.Trim(),false);
这样就行了!

17,740

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧