AI OnAI Off
Sure, override AccessDenied in the codebehind for the template/ASPX that handles this competition page and make your own implementation.
Thanks for that pointer Per.
Just in case anyone else has this problem, here's the solution I've come up with.
I put this little override function together, using some code from Joshua Flanagan's Custom Error HttpModule.
public override void AccessDenied()
{
string redirectPage;
CustomErrorsSection section = WebConfigurationManager.GetWebApplicationSection(@"system.web/customErrors") as CustomErrorsSection;
if (section == null || section.Mode == CustomErrorsMode.Off)
{
base.AccessDenied();
}
else
{
CustomError definedError = section.Errors.Get("404");
redirectPage = (definedError != null) ? definedError.Redirect : section.DefaultRedirect;
Response.Redirect(redirectPage);
}
}
Jim.
We have a client who wants to use the StartPublish and StopPublish properties to automatically take down competitions and offers. The problem is that if the page has timed out, or is inaccessible to normal visitors, then a user is redirected to the Login page, which is not what we want.
Is there a way that we can intercept this redirection and redirect the user to a generic Offer Closed page?
Thanks,
Jim.