Show the last day of each month on Date AjaxControlToolkit c #

0

Good a query as I do so that it is only active the last day of every month in date in aspx AjaxControlToolkit c #?

<tr>
    <td>Fecha</td>
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager>
    <td>
        <asp:TextBox ID="txtFecha_FDM" class="form-control" runat="server" Placeholder="Ingrese la Fecha(año,mes,dia)" required></asp:TextBox>
    </td>
    <cc1:CalendarExtender ID="Calendar1" PopupButtonID="txtFecha_FDM" runat="server" TargetControlID="txtFecha_FDM" Format="dd/MM/yyyy"> </cc1:CalendarExtender>  
</tr>
    
asked by PieroDev 01.03.2017 в 19:59
source

1 answer

1

you can set SelectedDate to the last day of the month that would be calculated like this and then lock the control so that you can not edit or select dates

DateTime now = DateTime.Now;
var startDate = new DateTime(now.Year, now.Month, 1); // iniciar el primer día de mes
// Establecer esta variable al Calendar
var endDate = startDate.AddMonths(1).AddDays(-1); // este es el último día del mes en curso. 
    
answered by 02.03.2017 в 11:53