private void RenderButtons(NavHtmlTextWritter textWriter) { // Buttons Control-Group textWriter.AddAttribute(HtmlTextWriterAttribute.Class, "form-group"); textWriter.RenderBeginTag((HtmlTextWriterTag)HtmlTextWriterTag.Div); // Controls Div textWriter.AddAttribute(HtmlTextWriterAttribute.Class, "controls"); textWriter.RenderBeginTag((HtmlTextWriterTag)HtmlTextWriterTag.Div); // Submit Button textWriter.AddAttribute(HtmlTextWriterAttribute.Type, "submit"); textWriter.AddAttribute(HtmlTextWriterAttribute.Class, "btn btn-default btn-primary"); textWriter.AddAttribute(HtmlTextWriterAttribute.Value, "Submit"); textWriter.RenderBeginTag((HtmlTextWriterTag)HtmlTextWriterTag.Input); textWriter.RenderEndTag(); //</input> textWriter.Write(" "); // Cancel Button textWriter.AddAttribute(HtmlTextWriterAttribute.Type, "button"); textWriter.AddAttribute(HtmlTextWriterAttribute.Class, "btn btn-default"); textWriter.AddAttribute(HtmlTextWriterAttribute.Value, "Cancel"); textWriter.AddAttribute(HtmlTextWriterAttribute.Onclick, "window.location = '" + helper.ViewContext.HttpContext.Request.UrlReferrer + "'"); textWriter.RenderBeginTag((HtmlTextWriterTag)HtmlTextWriterTag.Input); textWriter.RenderEndTag(); //</input> textWriter.RenderEndTag(); // div (Controls Div) textWriter.RenderEndTag(); // div (Buttons Control-Group) }
private static void PageItem(NavHtmlTextWritter textWriter, MvcHtmlString linkBlock, string cssClass = "") { if (cssClass != string.Empty) { textWriter.AddAttribute(HtmlTextWriterAttribute.Class, cssClass); } textWriter.RenderBeginTag(HtmlTextWriterTag.Li); textWriter.Write(linkBlock); textWriter.RenderEndTag(); }