I'm trying to mimic the Application_BeginRequest in a non-MVC Kentico setup, and have a custom handler module loader with a RequestEvents.Begin.Execute method. Depending on a particular condition, I want to redirect the user, but the Response object is not available (for Response.Redirect(...)). HttpContext is also not available.
The first parameter of the RequestEvents method is a CMS.Base.SimpleHandler, and there's nothing there that seems to fit the bill either. Second parameter is the base EventArgs which doesn't help either.
Hello,
Please use one of following methods:
URLHelper.RedirectPermanent -> for 301 redirects URLHelper.Redirect -> for 302 redirects
Best regards, Jan Hermann
Please, sign in to be able to submit a new answer.