Date.cshtml 560 B

1234567891011121314151617
  1. @model Nullable<DateTime>
  2. @{
  3. IDictionary<string, object> htmlAttributes;
  4. object objAttributes;
  5. if (ViewData.TryGetValue("htmlAttributes", out objAttributes))
  6. {
  7. htmlAttributes = objAttributes as IDictionary<string, object> ?? HtmlHelper.AnonymousObjectToHtmlAttributes(objAttributes);
  8. }
  9. else
  10. {
  11. htmlAttributes = new RouteValueDictionary();
  12. }
  13. htmlAttributes.Add("type", "text");
  14. htmlAttributes["class"] += " datefield";
  15. String format = "{0:d}";
  16. @Html.TextBox("", Model, format, htmlAttributes)
  17. }