MVC Html Helpers

DropDownListFor View helper sample code @Html.DropDownListFor(model => model.OperatorValue, (List<SelectListItem>)ViewData[“OperatorValue_SelectList”], new { @class = “form-control” }) Controller sample code, this can […]

Read more

MVC Data Annotations

Date formatting [DisplayFormat(DataFormatString = “{0:dd/MM/yyyy}”, ApplyFormatInEditMode = true)] Number formatting [DisplayFormat(DataFormatString = “{0:N}”, ApplyFormatInEditMode = true)]

Read more

MVC Controllers

Web Result ActionResult Web Return return RedirectToAction(“ActionName”, “ControllerName”, new { id = vwModel.SomeId }); return View(“ViewName”, vwModel); return PartialView(“_PartialViewName”, vwModel); […]

Read more