Sitecore: What is the advantage of Sitecore.Web.WebUtil.Redirect over Response.Redirect?

Are there any advantages or differences when using ...

Sitecore.Web.WebUtil.Redirect(string path) 

... instead of ...

 Response.Redirect(string url) 

... for redirection?

+4
source share
1 answer

There is one significant difference. The Sitecore method verifies that there is actually an HttpContext . In addition, there is no difference, because Sitecore.Web.WebUtil.Redirect(string path) in turn calls HttpContext.Current.Response.Redirect(path, true) ;

However, if you call Sitecore.Web.WebUtil.Redirect(path, false) , and the path you specify is the same page that you are not redirecting to.

+8
source

All Articles