November Happy Hour will be moved to Thursday December 5th.

Unavailable Product - Show Details Page

Vote:
 

Ok, so I have this client requirement to be able to display a 'crippled' version of the product details page for products that are not available (expired, etc.).

The OOTB functionality is to redirect the user to home page / login page if they try to browse the direct link to an unavailable product.

As this is a MVC implementation I've gone down the route of overriding the OnAuthorization method in my base product controller and implementing a custom AccessDeniedHandler. This is where I'm stuck though.

// 
        /// Handles access denied for forms authentication scenarios by redirecting to the logon form.
        /// 
        /// 
        private static void FormLogonAccessDenied(AuthorizationContext filter)
        {
            // ??
        }

Does anyone have any suggestions for how to bypass the underlying authorization and continue to call the product controller Index action??

#131309
Jul 21, 2015 5:50
Vote:
 

Hi,

I don't really get your issue, but if your product detail page implement ContentControlBase<T>, then check at Page_Load to see if the current content is available or not. If not, redirect to the cripped view.

Regards.

/Q

#131379
Jul 22, 2015 13:15
* 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.