2010-01-12 82 views

回答

15
void ProcessRequest(HttpContext context) 
{ 
    context.Response.Redirect(newUrl); 
} 
0

使用context.Response.Redirect(NEWURL);導致頁面上顯示:

「對象已移至here」。

更新: 發生這種情況是因爲我退出了,在這種情況下,答案是使用FormsAuthentication.RedirectToLoginPage();

-1

我發現了一個解決方案,它應該很好地工作:

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>"); 
}