Click here to Skip to main content
15,907,395 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

i am using CalendarExtender in that i want to disable only sunday,monday dates only for throught year. when i select monday or sunday date it will not selectable and i want to apply red colour those days.

how i want to write the code

please give me solution as early as possible


Regards,

D.V.Mallikarjuna Guptha
Posted

Look here for details of how you can do it here:
ASP.NET AJAX Calendar Extender Tips and Tricks[^]

For Red color part, apply CSS.
 
Share this answer
 
XML
<script type="text/javascript">
    function checkDate(sender,args)
{
 if (sender._selectedDate < new Date())
            {
                alert("You cannot select a day earlier than today!");
                sender._selectedDate = new Date();
                // set the date back to the current date
sender._textbox.set_Value(sender._selectedDate.format(sender._format))
            }
}
    </script>


and on extender textbox you have to call checkdate function
XML
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
         <cc1:CalendarExtender ID="CalendarExtender1"
         runat="server" OnClientDateSelectionChanged="checkDate" TargetControlID="TextBox1" /

this can give you better idea how to customize you control according to any requirment.
if you have any other question regarding to development .please feel free to contact http://www.visiostudio.net or mail me at info@visiostudio.net
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900