📜  Response.Redirect 不能在页面回调中调用 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:50.296000             🧑  作者: Mango

代码示例1
// Butchered together from multiple answers

if (!Page.IsCallback)
    Request.Redirect("~/Error.aspx");
else
  HttpContext.Current.Response.RedirectLocation =
              System.Web.VirtualPathUtility.ToAbsolute("~/Error.aspx");