DatePicker in MVC

Unknown | 7:12 PM |

View


@model DatePickerTemp.Models.FooEditModel
@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    Edit</h2>
@Model.Message
@using (Html.BeginForm())
{
    @Html.EditorFor(m => m.Foo)
    <input id="submit" name="submit" type="submit" value="Save" />
}

Models


using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using DatePickerTemp.Infrastructure;

namespace DatePickerTemp.Models
{
    public class Foo
    {
        public string Name { get; set; }

        [DataType(DataType.Date)]
        public DateTime Date1 { get; set; }

        [DateRange(Min = "2010/12/02")]
        public DateTime Date2 { get; set; }

        [DateRange(Max = "2010/12/20")]
        public DateTime Date3 { get; set; }

        [DateRange(Min = "2010/12/02", Max = "2010/12/20")]
        public DateTime Date4 { get; set; }
    }
}



namespace DatePickerTemp.Models
{
    public class FooEditModel
    {
        public string Message { get; set; }
        public Foo Foo { get; set; }
    }
}
DatePicker.zip

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....