SaaS CMS has officially launched! Learn more now.

Login page displayed when page has passed StopPublish date.


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?



May 07, 2008 11:52

Sure, override AccessDenied in the codebehind for the template/ASPX that handles this competition page and make your own implementation.


May 07, 2008 15:39

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)
CustomError definedError = section.Errors.Get("404");
redirectPage = (definedError != null) ? definedError.Redirect : section.DefaultRedirect;


Edited, May 07, 2008 18:10
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.