Is there any advantage or difference when using...
Sitecore.Web.WebUtil.Redirect(string path)
...instead of...
Response.Redirect(string url)
...for redirecting?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With