/// <summary> /// Creates the HTML for a submit <input> (or optionally <button>) that submits a value in the form post when clicked. /// </summary> /// <remarks> /// Uses an <input> 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 <button> rather than <input> 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)); }
/// <summary> /// Creates the HTML for a <button>. /// </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)); }