locked
CalendarExtender initially appears blank RRS feed

  • Question

  • User339909181 posted

    I have a small standalone development project and am designing a form page in it.

    It has a CalendarExtender, I notice that when it is initially popped up it is blank appart from the left/right arrow.

    Pressing an arrow and the month appears OK and from then on it's OK.

    Any ideas why.

    If I create a brand new project and paste the code in it then works OK.

    So it must be something in my project I think.

    Jim ( Code below )

    <%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site1.Master"
        CodeBehind="JimsTestPage.aspx.vb" Inherits="BiflDemo.JimsTestPage" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <asp:Content ID="Content2" ContentPlaceHolderID="DetailsPage" runat="server">
        <cc1:ToolkitScriptManager ID="ScriptManager2" runat="server" EnableHistory="True">
        </cc1:ToolkitScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <tr>
                    <td class="col2">
                        <asp:TextBox ID="txtFromDate" runat="server" 
                            AutoPostBack="True" TabIndex="5"></asp:TextBox>
                        <cc1:CalendarExtender ID="txtFromDate_CalendarExtender" runat="server" TargetControlID="txtFromDate">
                        </cc1:CalendarExtender>
                    </td>
                </tr>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Content>  





    Friday, September 17, 2010 4:33 AM

All replies

  • User1007520750 posted

    Hi

  • <ContentTemplate>  
  •             <tr>  
  •                 <td class="col2">  
  •                     <asp:TextBox ID="txtFromDate" runat="server"   
  •                         AutoPostBack="True" TabIndex="5"></asp:TextBox>  
  •                     <cc1:CalendarExtender ID="txtFromDate_CalendarExtender" runat="server" TargetControlID="txtFromDate">  
  •                     </cc1:CalendarExtender>  
  •                 </td>  
  •             </tr>  
  •         </ContentTemplate>

I would deffenetly first remove the <tr> and <td> which, of some reason don't have a <table> tag attached, and then try again. Using such broken HTML can cause a problem like you describe, I think.

If you need to style the Textbox container (class="col2"), then use a div instead:

...
<ContentTemplate>  
    <div class="col2">  
        <asp:TextBox ID="txtFromDate" runat="server"   
            AutoPostBack="True" TabIndex="5"></asp:TextBox>  
        <cc1:CalendarExtender ID="txtFromDate_CalendarExtender" runat="server" TargetControlID="txtFromDate">  
        </cc1:CalendarExtender>  
    </div> 
</ContentTemplate>
...

By the way, why do you need the "AutoPostback=true" on the Textbox? You defenetly don't need it for the extender. If anything, I would bet it might also be a part of the problem.

Amit

Friday, September 17, 2010 5:13 AM
  • User1992938117 posted

    Hi use this css in master page then check

    .AjaxCalendar .ajax__calendar_container 
    {
    	border:1px solid #646464;
        background-color: yellow;
        color: red;
    }
    
    .AjaxCalendar .ajax__calendar_other .ajax__calendar_day,
    .AjaxCalendar .ajax__calendar_other .ajax__calendar_year 
    {
    	color: Black;
    }
    
    .AjaxCalendar .ajax__calendar_hover .ajax__calendar_day,
    .AjaxCalendar .ajax__calendar_hover .ajax__calendar_month,
    .AjaxCalendar .ajax__calendar_hover .ajax__calendar_year 
    {
    	color:  White;
    }
    
    .AjaxCalendar .ajax__calendar_active .ajax__calendar_day,
    .AjaxCalendar .ajax__calendar_active .ajax__calendar_month,
    .AjaxCalendar .ajax__calendar_active .ajax__calendar_year 
    {
    	color: Purple;
    	font-weight:bold;
    }

    Calender:

    <ajaxToolkit:CalendarExtender ID="customCalendarExtender" runat="server" TargetControlID="Date2"
               CssClass="MyCalendar" Format="MMMM d, yyyy" SelectedDate="April 28, 1906" PopupPosition="Left"/>


    Friday, September 17, 2010 5:20 AM
  • User339909181 posted

    Sorted the missing <table> and removed AutoPostBack="True" but still the same.

    Created style for .AjaxCalendar   and calendar box now appear in a pretty yellow colour, but it's still initially blank ??

    Thanks for the replies

    Jim


    Friday, September 17, 2010 5:46 AM
  • User-1102123764 posted

    Hi,

    Try to move the CalendarExtender out of the UpdatePanel. 

    Sunday, September 19, 2010 11:28 PM
  • User339909181 posted

    I get the error ...

    An extender can't be in a different UpdatePanel than the control it extends.

    Nice try I was hopeful !

    Jim



    Wednesday, September 29, 2010 8:42 AM
  • User-1102123764 posted

    Hi,

    Would you please post the css class of col2

    Wednesday, September 29, 2010 10:32 PM
  • User339909181 posted

    it is

    .col2
            {
                width: 500px;
            }

    Thursday, September 30, 2010 8:03 AM
  • User-1102123764 posted

    Hi,

    I could not reproduce the issue, could you please send me your project to my email box?

    I will send you my email address by private message. 

    Thursday, September 30, 2010 10:17 PM
  • User-2089071126 posted

    I know this is an ancient issue... Did you ever get this resolved... I"m having a similar issue.

    Friday, January 16, 2015 12:33 PM