7

httpステータスコード303(SeeOther)を使用して、ASP.NETで現在のリクエストをリダイレクトする方法を知っている人はいますか。

コード スニペットは大歓迎です。

4

2 に答える 2

16

次のようにできるはずです。

  HttpContext.Current.Response.Clear();
  HttpContext.Current.Response.Status = "303 See Other";
  HttpContext.Current.Response.AddHeader("Location", newLocation);
  HttpContext.Current.Response.End();
于 2012-02-29T10:40:12.173 に答える