public HtmlDocument Products_Id(ViewProductRequest request) { var product = _crudService.Retrieve(request.Id); var document = new HtmlDocument(); var container = new DivTag(""); container.Append(new HtmlTag("h1").Text(product.Number + " - " + product.Name)); container.Append(new HtmlTag("h2").Text("$" + product.Price.ToString("F2"))); container.Append(new HtmlTag("h3").Text(product.Description)); document.Add(container); return document; }
private static HtmlTag MakeRadioButton(string display, object value, string name) { DivTag divTag = new DivTag(display); HtmlTag radioButton = new RadioButtonTag(false).Attr("value", value).Attr("name",name); HtmlTag label = new HtmlTag("label").Text(display); label.Append(radioButton); divTag.Append(label); return divTag; }
public static HtmlTag DebugGrid(this HtmlHelper htmlHelper) { var tag = new DivTag(); tag.Append(new DivTag().AddClass("alert alert-info text-center visible-xs").Text("Extra Small")) .Append(new DivTag().AddClass("alert alert-info text-center visible-sm").Text("Small")) .Append(new DivTag().AddClass("alert alert-info text-center visible-md").Text("Medium")) .Append(new DivTag().AddClass("alert alert-info text-center visible-lg").Text("Large")); return tag; }