Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用する際の利点や違いはありますか...
Sitecore.Web.WebUtil.Redirect(string path)
...それ以外の...
Response.Redirect(string url)
...リダイレクト用ですか?
大きな違いが1つあります。Sitecoreメソッドは、実際にが存在することを確認しHttpContextます。それ以外はSitecore.Web.WebUtil.Redirect(string path)、順番に呼び出すように違いはありませんHttpContext.Current.Response.Redirect(path, true);
HttpContext
HttpContext.Current.Response.Redirect(path, true)
ただし、電話をかけSitecore.Web.WebUtil.Redirect(path, false)て、指定したパスが同じページである場合、リダイレクトは発生しません。
Sitecore.Web.WebUtil.Redirect(path, false)