locked
CalendarExtender not working RRS feed

  • Question

  • User1844107964 posted

    hi

    i'm using CalendarExtender but calendar is not shown at all when i click on textbox or image button, so i must be doing something wrong and can't figure it out.

    i'm using VS2008, framework 3.5.

    this is my code:

    <%@ Page Title="" Language="VB" MasterPageFile="~/PlanMaster.master" AutoEventWireup="false" CodeFile="PlanTrip.aspx.vb" Inherits="PlanTrip" %>

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
        <style type="text/css">
            .divRectangle
                {
                    width:572px;
                    height:590px;
                    border: solid 1px #6B696B;
                    padding-left:5px;
                    padding-top:5px;
                    padding-bottom:5px;
                    ;
                    /*;*/
                    margin: auto;
                    top: 0; left: 0; bottom: 0; right: 0;
                }
                
            .pnl
            {
                width:580px;
                height:604px;
                background-color:#F7F7DE;
            }

    .divBlank20
    {
        height:20px;
    }

    .lbl
    {
        width:150px;
    }

    .txt
    {
        width:140px;
    }
        </style>
    </asp:Content>

    <asp:Content ID="Content2" ContentPlaceHolderID="Main" Runat="Server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering ="true">
        </asp:ScriptManager>
        <div class="divHeading">
            <h2>
                <asp:Label ID="lblHeading" runat="server" Text="Plan trip"></asp:Label>
            </h2>
        </div>
        <div class="divBlank20"></div>
        
        <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>--%>
                <div>
                    <asp:Label ID="lblError" runat="server" Text=""></asp:Label>
                </div>
                <asp:Panel ID="pnlNew" runat="server" CssClass="pnl">
                <div class="divRectangle">
                    <div>
                        <asp:Label CssClass="lbl" ID="Label7" runat="server" Text="Date from:"></asp:Label>
                        <asp:TextBox CssClass="txt" ID="txtDateFrom" runat="server"></asp:TextBox>
                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDateFrom" ></cc1:CalendarExtender>
                        <%--<asp:ImageButton ID="btn" runat="server" ImageUrl="images/Calendar_scheduleHS.png" />--%>
                        <%--<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDateFrom" PopupButtonID="btn"></cc1:CalendarExtender>--%>
                    </div>

                    <div class="divBlank20"></div>
                    <div style="float:left; width:100px;">
                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
                    </div>
                    <div style="float:left; width:460px; text-align:right;">
                        <asp:Button ID="btnSave" runat="server" Text="Save" />
                    </div>
                </div>
                <div class="clear"></div>
                </asp:Panel>
                <div class="divBlank20"></div>
           <%-- </ContentTemplate>
        </asp:UpdatePanel>--%>
    </asp:Content>

    i have to say that i can't use popupmodal extender (doesn't popup) as well ...

    thanks for help in advance

    Wednesday, November 20, 2013 10:15 AM

Answers

  • User-1965857832 posted

    Give it a try by adding ToolkitScriptManager instead of ScriptManager to ur page.

    You must add a ToolkitScriptManager control to any page that contains Ajax Control Toolkit controls. The ToolkitScriptManager performs two main functions. First, the ToolkitScriptManager handles dependency resolution. The ToolkitScriptManager is responsible for loading all of the JavaScript files required by a set of Ajax Control Toolkit controls. Second, the ToolkitScriptManager is responsible for optimizing JavaScript and files. The ToolkitScriptManager combines, minifies, compresses and caches JavaScript files so that they can be delivered more efficiently to the browser.

    Check this for details

    ToolkitScriptManager

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 20, 2013 10:27 AM

All replies

  • User-1965857832 posted

    Give it a try by adding ToolkitScriptManager instead of ScriptManager to ur page.

    You must add a ToolkitScriptManager control to any page that contains Ajax Control Toolkit controls. The ToolkitScriptManager performs two main functions. First, the ToolkitScriptManager handles dependency resolution. The ToolkitScriptManager is responsible for loading all of the JavaScript files required by a set of Ajax Control Toolkit controls. Second, the ToolkitScriptManager is responsible for optimizing JavaScript and files. The ToolkitScriptManager combines, minifies, compresses and caches JavaScript files so that they can be delivered more efficiently to the browser.

    Check this for details

    ToolkitScriptManager

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 20, 2013 10:27 AM
  • User555306248 posted

    Are you getting JavaScript error?

    Try placing the toolkitscriptmanager just after your <form> element. It could be do to the fact that it is placed within a templated control and therefore rendering way too late in the page's lifecycle.

    Wednesday, November 20, 2013 11:29 PM
  • User1844107964 posted

    yes, i put ToolkitScriptManager instead ScriptManager and it works.

    but how come that in most examples that i've found there is ScriptManager and these examples work with it?

    Thursday, November 21, 2013 7:03 AM