Article

Jquery Datepicker Date Range Restriction in Asp.net

18 Jun 2015 Kamal Pratap
1 Comments 2842 Views



Here we explain how to set jquery datepicker on textbox with date range validator in asp.net. Yor can set it using mindate and maxdate properties.

Jquery Datepicker Date Range Restriction in Asp.net

Asp.Net:


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>jQuery UI Datepicker in Asp.Net</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <script>
        $(function () {
            $("#datepicker").datepicker({ minDate: -5, maxDate: +5 });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Date:
        <asp:TextBox ID="datepicker" runat="server"></asp:TextBox>
    </div>
    </form>
</body>
</html>

 

Kamal Pratap

I have 6+ years experience in .Net technologies like Asp.Net, C#, WCF, Web Services, SQL Server, Ajax, LinQ. Currently I am working in Netcarrots Loyalty Services as a Software Developer.

Comments

  1. Nice one..

    1. Thanks..

Leave a Comment