Here I will explain how to show only current dates of current month or whichever month in ajax calendar extender using asp.net.
Description
We can display only current month days to user in calendar control just by using css styles First add Ajax tollkit reference to your project and register that ajax referece like this in your aspx page
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
After that design your aspx like this
<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> /*Calendar Control CSS*/ .cal_Theme1 .ajax__calendar_other .ajax__calendar_day, .cal_Theme1 .ajax__calendar_other .ajax__calendar_year { color:White; /*Your background color of calender control*/ } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="script" runat="server"> </asp:ScriptManager> <div> <asp:TextBox SkinID="txtboxCustomizedMSkin" ID="tbEndDate" runat="server" CausesValidation="true" ReadOnly="true" Width="175px" /> <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="tbEndDate" CssClass= " cal_Theme1" /> </div> </form> </body> </html> |
Demo
Download sample code attached
Related AJAX calendar control posts
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
2 comments :
hi suresh,
i want to display only the year in the textbox is it possible
How to change previous date css
Note: Only a member of this blog may post a comment.