jQuery Datepicker with asp.net

In asp.net we have to add Ajax control library for Datepicker,which takes time to get load on page and heavy control too. We have one alternative for that jquery datepicker with asp.net.

Here we have first add jquery link and javascript reference as bellow:

<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" href="/resources/demos/style.css" />

Write a code for popup Jquery datepicker with textbox as bellowed:

<script>
 $(function () {
       $("#<%=txtDate.ClientID%>").datepicker();
    });
</script>

asp.net form code which is as  bellow:

<form id="form1" runat="server">
    <div>
        <asp:Label Text="Jquery DatePicker: " runat="server" ID="lbl" />
        <asp:TextBox ID="txtDate" runat="server" />
    </div>
</form>

Screenshot:

jQuery-Datepicker-with-asp.net_
jQuery Datepicker with asp.net

We can also change the css style of JQuery Datepicker with asp.net.

Download code for jQuery Datepicker with asp.net

Leave a Reply