Reputation: 65
I have an aspx page with a master page. The master page contains the asp:ScriptManager. The aspx page's ajaxToolkit:CalendarExtender has quit changing the month of the date in the textbox. The textbox associated with the extender is filled with information from a database when the page is loaded.
This aspx page was created several months ago and has been working fine. I had to add a couple of additional divs to the end of it during an update and the Calendar Extender continued to work as intended for a couple of weeks. Yesterday it decided not to change the month in the textbox when a different date was chosen in the calendar control. The changes I made had nothing to do with the extender or the area in which it is contained so I am completely mystified as to what caused the problem.
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
Inherits="Quote.Edit" Title="Quote - Edit Information"
CodeBehind="Rate.aspx.vb" %>
<%@ Register Src="TabsControl.ascx" TagName="TabsControl" TagPrefix="uc1" %>
<asp:Content>...several other Contents here...</Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainPlaceHolder" runat="server">
<asp:UpdatePanel ID="upContent" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">
<ContentTemplate>
<div>...several other divs here...</div>
<div class="other=container">
<asp:UpdatePanel ID="upEdit" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">
<ContentTemplate>
<div id="EditArea" runat="server">
<table class="general">
<tr>...several other rows here...</tr>
<tr><td colspan="2>
<asp:Label id="lblEffDate" runat="server" AssociatedControlID="txtEffDate" Text="Effective Date" />
<div>
<asp:Textbox ID="txtEffDate" runat="server" Width="100" CssClass="notfirst" AutoPostBack="true" />
<asp:Image ID="imgCal" runat="server" ImageUrl="images/Calendar_scheduleHS.png" CssClass="top3" />
</div>
<ajaxToolkit: CalendarExtender ID="ceEffDate" PopupButtonID="imgCal" TargetControlID="txtEffDate" Animated="false" runat="server" Format="mm/dd/yyyy" />
<ajaxToolkit: MaskedEditExtender ID="meEffDate" runat="server" MaskType="Date" TargetControlID="txtEffDate" Mask="99/99/9999" />
</td></tr>
<tr>...several other rows here...</tr>
</table>
</div>
<div>...several other divs here...</div>
</ContentTemplate>
</UpdatePanel>
</div>
</ContentTemplate>
</UpdatePanel>
</Content>
There is a huge amount of code before and after this but this is the area where the date controls are located.
The only code-behind involved is getting the information from the database and loading it to the textbox. Its when you change the date with the Calendar Extender that the month is staying the same in the textbox (the day and the year will change.)
Upvotes: 0
Views: 2742
Reputation: 724
Your date format is wrong. 'M' should be capital for month like this: Format="MM/dd/yyyy"
<ajaxToolkit: CalendarExtender ID="ceEffDate" PopupButtonID="imgCal" TargetControlID="txtEffDate" Animated="false" runat="server" Format="MM/dd/yyyy" />
Upvotes: 2