public static MvcHtmlString SubmitButton(this AjaxHelper ajaxHelper, ButtonType buttonType, string buttonText, ButtonIcon buttonIcon = ButtonIcon.Ok)
        {
            var htmlStr = "<button  type='submit'>REPLACE</button>";
            var button  = new ButtonParameters(buttonIcon, buttonType, buttonText);

            return(button.ButtonConstructor(htmlStr));
        }
        public static MvcHtmlString GridTopDialogForm(this HtmlHelper helper, ButtonParameters buttonParameters, ActionParameters actionParameters, ActionDialogFormParamters actionDialogFormParamters)
        {
            var fdButton   = helper.ActionDialogFormButton(buttonParameters, actionParameters, actionDialogFormParamters).ToString();
            var gridTopDiv = "<div class='t-toolbar t-grid-toolbar t-grid-top'>DIAGFORMBUTTON</div>";
            var comb       = gridTopDiv.Replace("DIAGFORMBUTTON", fdButton);

            return(new MvcHtmlString(comb));
        }
        public static MvcHtmlString ActionButtonConstructor(ButtonParameters buttonParameters, string htmlStr)
        {
            htmlStr = HTMLHelper.AddClassToHtmlElement(htmlStr, string.Format("btn {0} {1} {2}", _htmlButtonRole[buttonParameters.ButtonRole]
                                                                              , _htmlButtonHeight[buttonParameters.ButtonHeight]
                                                                              , (!buttonParameters.Enabled?" .disabled":"")));
            if (!string.IsNullOrEmpty(buttonParameters.ToolTip))
            {
                htmlStr = HTMLHelper.AddAttributesToHtmlElement(htmlStr, "rel='tooltip'");
                htmlStr = HTMLHelper.AddAttributesToHtmlElement(htmlStr, string.Format("title='{0}'", buttonParameters.Text));
            }

            htmlStr = (!buttonParameters.Enabled) ? HTMLHelper.AddAttributesToHtmlElement(htmlStr, "disabled='disabled'") : htmlStr;
            htmlStr = (buttonParameters.ButtonId != null) ? HTMLHelper.AddAttributesToHtmlElement(htmlStr, "id='" + buttonParameters.ButtonId + "'") : htmlStr;
            var innerHtml = string.Format("{0}{1}", IconConstructor.ConstructIcon(new IconParameters(buttonParameters.ButtonIcon, buttonParameters.ButtonIconColor))
                                          , buttonParameters.Type == ButtonType.ImageText ? " " + buttonParameters.Text:"");

            htmlStr = (buttonParameters.Width != null) ? HTMLHelper.AddStyleAttributeToHtmlElement(htmlStr, string.Format("width:{0};text-align:left", buttonParameters.Width)) : htmlStr;
            htmlStr = htmlStr.Replace("REPLACE", innerHtml);
            return(new MvcHtmlString(htmlStr));
        }
        public static MvcHtmlString ActionButton(this AjaxHelper ajaxHelper, ButtonParameters buttonParameters, ActionParameters actionParameters, AjaxOptions ajaxOptions)
        {
            var htmlStr = ajaxHelper.ActionLink("REPLACE", actionParameters.Action, actionParameters.Controller, actionParameters.RouteValues, ajaxOptions).ToHtmlString();

            return(buttonParameters.ButtonConstructor(htmlStr));
        }
 public static MvcHtmlString ActionButton(this AjaxHelper ajaxHelper, ButtonParameters buttonParameters, string actionName, AjaxOptions ajaxOptions)
 {
     return(ActionButton(ajaxHelper, buttonParameters, new ActionParameters(actionName), ajaxOptions));
 }