.net 从.ashx文件重定向响应
我有ashx文件,我想从ashx重定向到aspx页面。一些解决方案?使用context.Response.Redirect(newUrl);结果显示一个页面,其中显示:.net 从.ashx文件重定向响应,.net,ashx,.net,Ashx,我有ashx文件,我想从ashx重定向到aspx页面。一些解决方案?使用context.Response.Redirect(newUrl);结果显示一个页面,其中显示: void ProcessRequest(HttpContext context) { context.Response.Redirect(newUrl); } “对象已移动到。” 更新: 这是因为我注销了,在这种情况下,答案是使用FormsAuthentication.RedirectToLoginPage() 我找
void ProcessRequest(HttpContext context)
{
context.Response.Redirect(newUrl);
}
“对象已移动到。”
更新:
这是因为我注销了,在这种情况下,答案是使用FormsAuthentication.RedirectToLoginPage() 我找到了一个解决方案,它应该可以正常工作:
context.Response.ContentType = "text/plain";
if (controlcase)
{
//Write code, what you want...
context.Response.Write("This is result");
}
else
{
context.Response.Write("<script>location.href='url you want to redirect'</script>");
}
context.Response.ContentType=“text/plain”;
if(控制案例)
{
//写代码,你想要什么。。。
context.Response.Write(“这是结果”);
}
其他的
{
context.Response.Write(“location.href='url you want redirect'”);
}