Enabling only one week in ajax calendar extender

Last Reply 6 days ago By AnandM

Posted 7 days ago

HI Can anyone help me, i only want to enable one week in ajax calendar extender , it was simple in asp calendar control, how to do it in ajax calendar extender. 

like i only want to enable sundays in calendar

You are viewing reply posted by: AnandM 6 days ago.
Posted 6 days ago

Hi Mudassirk7,

Unfortunately there are no server side events attached to the Ajax CalendarExtender like ASP.net Calendar. Ajax CalendarExtender is attached with client side events like OnClientDateSelectionChanged and etc.

So you need to do workaround for achieving the task and for that i have already provided solution to you in my previous reply.

http://www.aspforums.net/Threads/645107/Enabling-only-one-week-in-ajax-calendar-extender/Replies/2#Replies

and you can achieve your requirement with jquery datepicker.

Refer below sample code.

HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input type="text" id="txtSundays" />
        <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/base/jquery-ui.css"
            type="text/css" media="all" />
        <link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css"
            type="text/css" media="all" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"
            type="text/javascript"></script>
        <style type="text/css">
            .ui-datepicker-week-end a.ui-state-default
            {
                color: green;
            }
        </style>
        <script type="text/javascript">
            $(function () {
                var date = new Date();
                $("#txtSundays").datepicker({
                    autoclose: true,
                    changeMonth: true,
                    changeYear: true,
                    changeDate: true,
                    minDate: new Date(),
                    beforeShowDay: function (date) {
                        return [date.getDay() === 0, ''];
                    }
                });
            });
        </script>
    </div>
    </form>
</body>
</html>

Demo

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html?aff_id=108