Beispiel #1
0
        protected internal ViewResult ViewModal(string viewName, object model, DynamicModalOptions dynamicModalOptions)
        {
            ViewBag.IsForm = false;

            if (dynamicModalOptions != null)
            {
                if (dynamicModalOptions.Title != null)
                {
                    ViewBag.Title = dynamicModalOptions.Title;
                }
                else
                {
                    ViewBag.Title = null;
                }

                if (dynamicModalOptions.ActionName != null)
                {
                    ViewBag.ActionName = dynamicModalOptions.ActionName;
                }
                else
                {
                    ViewBag.ActionName = null;
                }

                if (dynamicModalOptions.ControllerName != null)
                {
                    ViewBag.ControllerName = dynamicModalOptions.ControllerName;
                }
                else
                {
                    ViewBag.ControllerName = null;
                }

                if (dynamicModalOptions.FormMethod != null)
                {
                    ViewBag.FormMethod = dynamicModalOptions.FormMethod;
                    ViewBag.FormType   = dynamicModalOptions.FormType;
                    ViewBag.IsForm     = true;
                }
            }

            return(View(viewName, "~/Views/Shared/_DynamicModalLayout.cshtml", model));
        }
Beispiel #2
0
 protected internal ViewResult ViewModal(string viewName, DynamicModalOptions dynamicModalOptions)
 {
     return(ViewModal(viewName, model: null, dynamicModalOptions: dynamicModalOptions));
 }
Beispiel #3
0
 protected internal ViewResult ViewModal(object model, DynamicModalOptions dynamicModalOptions)
 {
     return(ViewModal(null /* viewName */, model, dynamicModalOptions: dynamicModalOptions));
 }