Sitecore:Sitecore.Web.WebUtil.Redirect优于Response.Redirect的优势是什么?

时间:2012-06-11 16:46:02

标签: asp.net redirect sitecore

使用时是否有任何优势或区别......

Sitecore.Web.WebUtil.Redirect(string path)

......而不是......

Response.Redirect(string url)

...用于重定向?

1 个答案:

答案 0 :(得分:11)

有一个主要区别。 Sitecore方法将检查实际上是HttpContext。除此之外没有区别,因为Sitecore.Web.WebUtil.Redirect(string path)依次调用HttpContext.Current.Response.Redirect(path, true);

但是,如果您致电Sitecore.Web.WebUtil.Redirect(path, false)并且您提供的路径与您所在的路径相同,则不会发生重定向。

相关问题