Tutorial by Examples

/// <summary> /// Gets displayName from DataAnnotations attribute /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <pa...
/// <summary> /// Creates simple button /// </summary> /// <param name="poHelper"></param> /// <param name="psValue"></param> /// <returns></returns> public static MvcHtmlString SubmitButton(this HtmlHelper poHelper, string ps...
HtmlHelper.Action() @Html.Action(actionName: "Index") output: The HTML rendered by an action method called Index() @Html.Action(actionName: "Index", routeValues: new {id = 1}) output: The HTML rendered by an action method called Index(int id) @(Html.Action("In...
Html.TextBox() @Html.TextBox("Name", null, new { @class = "form-control" }) output:<input class="form-control" id="Name"name="Name"type="text"value=""/> @Html.TextBox("Name", "Stack Overflow", new { ...
public static MvcHtmlString RadioButtonLabelFor<TModel, TProperty>(this HtmlHelper<TModel> self, Expression<Func<TModel, TProperty>> expression, bool value, string labelText) { // Retrieve the qualified model identifier string name = ExpressionHe...
public static MvcHtmlString DatePickerFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, object htmlAttributes) { var sb = new StringBuilder(); var metaData = ModelMetadata.FromLambdaExpression(expression, htm...

Page 1 of 1