Beispiel #1
0
        private static void TryRenderAction <TController>(this HtmlHelper helper, Expression <Action <TController> > action) where TController : Controller
        {
            bool IsErrorController(ViewContext vc) => vc != null && IsErrorController(vc.ParentActionViewContext);

            if (!IsErrorController(helper.ViewContext))
            {
                ViewExtensions.RenderAction(helper, action);
                return;
            }

            try
            {
                ViewExtensions.RenderAction(helper, action);
            }
            catch
            {
                // ignored
            }
        }