public void Generate_reset_button_with_html_content()
        {
            var h = HtmlCreator.BuildButton(new HtmlString("<b>content</b>"), "reset", "name", "value",
                                            new HtmlAttributes().Attr(id => "overriddenid").AddClass("lol")
                                            );

            HtmlApprovals.VerifyHtml(h.ToHtmlString());
        }
        /// <summary>
        /// Creates the HTML for a submit &lt;input&gt; (or optionally &lt;button&gt;) that submits a value in the form post when clicked.
        /// </summary>
        /// <remarks>
        /// Uses an &lt;input&gt; by default so the submitted value works in IE7.
        /// <see cref="http://rommelsantor.com/clog/2012/03/12/fixing-the-ie7-submit-value/"/>
        /// </remarks>
        /// <param name="name">The name (and id - use htmlAttributes to overwrite) of the element</param>
        /// <param name="value">The value to submit with the form</param>
        /// <param name="buttonText">If you want to use a &lt;button&gt; rather than &lt;input&gt; then specify this to set the text the user sees</param>
        /// <param name="htmlAttributes">Any HTML attributes that should be applied to the button</param>
        /// <returns>The HTML for the submit button</returns>
        public Nancy.ViewEngines.Razor.IHtmlString Submit(string name, string value, Nancy.ViewEngines.Razor.IHtmlString buttonText = null, HtmlAttributes htmlAttributes = null)
        {
            if (buttonText != null)
            {
                return(HtmlCreator.BuildButton(buttonText, "submit", name, value, htmlAttributes));
            }

            return(HtmlCreator.BuildInput(name, value, "submit", htmlAttributes));
        }
        /// <inheritdoc />
        /// <remarks>
        /// Uses an &lt;input&gt; by default so the submitted value works in IE7.
        /// See http://rommelsantor.com/clog/2012/03/12/fixing-the-ie7-submit-value/
        /// </remarks>
        public virtual IHtmlContent Button(IHtmlContent content, string type, string id, string value, HtmlAttributes htmlAttributes)
        {
            if (content == null && value == null)
            {
                throw new ArgumentNullException("content", "Expected one of content or value to be specified");
            }

            if (content == null)
            {
                return(HtmlCreator.BuildInput(id, value, type ?? "button", htmlAttributes));
            }

            return(HtmlCreator.BuildButton(content, type, id, value, htmlAttributes));
        }
        public void Generate_submit_button_with_non_default_options()
        {
            var h = HtmlCreator.BuildButton("thevalue&", "submit", "myId", htmlAttributes: new HtmlAttributes(new { onclick = "return false;", @class = "a&^&*FGdf" }));

            HtmlApprovals.VerifyHtml(h.ToHtmlString());
        }
        public void Generate_button_with_default_options()
        {
            var h = HtmlCreator.BuildButton("value");

            HtmlApprovals.VerifyHtml(h.ToHtmlString());
        }
 /// <summary>
 /// Creates the HTML for a &lt;button&gt;.
 /// </summary>
 /// <param name="content">The content to display in the button</param>
 /// <param name="htmlAttributes">Any HTML attributes that should be applied to the button</param>
 /// <returns>The HTML for the button</returns>
 public Nancy.ViewEngines.Razor.IHtmlString Button(Nancy.ViewEngines.Razor.IHtmlString content, HtmlAttributes htmlAttributes = null)
 {
     return(HtmlCreator.BuildButton(content, htmlAttributes: htmlAttributes));
 }
 /// <summary>
 /// Creates the HTML for a submit &lt;button&gt;.
 /// </summary>
 /// <param name="text">The text to display in the button</param>
 /// <param name="htmlAttributes">Any HTML attributes that should be applied to the button</param>
 /// <returns>The HTML for the submit button</returns>
 public Nancy.ViewEngines.Razor.IHtmlString Submit(string text, HtmlAttributes htmlAttributes = null)
 {
     return(HtmlCreator.BuildButton(text, "submit", htmlAttributes: htmlAttributes));
 }