Reputation: 4899
Is there any advantage or difference when using...
Sitecore.Web.WebUtil.Redirect(string path)
...instead of...
Response.Redirect(string url)
...for redirecting?
Upvotes: 5
Views: 3467
Reputation: 4008
There is one major difference. The Sitecore method will check that there is in fact a HttpContext
. Other than that there is no difference as 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 provide is the same page you on then no redirect will happen.
Upvotes: 12