Friday 23 October 2015

JQuery datepicker calender with Dropdown month and year in asp.net.

jquery datepicker with drodown to select month and year
Description:-



In this example we explain that how to Display calendar with Dropdown in month and year for selecting month and year in asp.net using jquery. Or display or bind month and year in DropdownList in calendar for selecting month and year in asp.net.

We already explain that display calendar in asp.net but in simple calendar if you want select before 50 year ago year then you have to press back button of the year in calendar control many time so it is time consuming. But now in this calendar you simply directally select year that you want in dropdown inside in calendar control.
 

datepicker.aspx:-



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="datepicker.aspx.cs" Inherits="kiritblog.datepicker" %>

<!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Display DatePicker Calendar With Dropdown selction Month and Year in Asp.Net
        using jquery.</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
    <script src="http://code.jquery.com/jquery-1.10.2.js" type="text/javascript"></script>
    <script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js" type="text/javascript"></script>
    <style type="text/css">
        body
        {
            font-size: 70%;
        }
    </style>
    <script type="text/javascript" language="javascript">
        $(function () {
            $("#<%=txtbirthdate.ClientID %>").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p>
            <b>Name :</b>
            <asp:TextBox ID="txtName" runat="server"></asp:TextBox><br />
            <b>Date Of Birth:</b>
            <asp:TextBox ID="txtbirthdate" runat="server"></asp:TextBox>
        </p>
    </div>
    </form>
</body>
</html>





0 comments:

Post a Comment