public static void RenderActionButton(this HtmlHelper helper, ActionButton model) { string templateName = defaultTemplateName; if (model.ControllerName.IsNullOrEmpty()) { model.ControllerName = (string)helper.ViewContext.RouteData.Values["controller"]; } if (model.ActionName.IsNullOrEmpty()) { model.ActionName = (string)helper.ViewContext.RouteData.Values["action"]; } helper.RenderPartial(templateName, model, helper.ViewDataContainer.ViewData); }