locked
AjaxControlToolkit CalendarExtender not working after publish RRS feed

  • Question

  • User-1854457768 posted

    I am using the AjaxControlToolkit CalendarExtender in my web site and its working in the visual studio 2012 but after publish to IIS Calendar Extender control won't show !

    asp.net code :

    <asp:TextBox ID="txtFrom" runat="server" Width="200"></asp:TextBox>
    <asp:Image ID="image1" runat="server" ImageUrl="~/Image/calendar.png" />
    <ajaxToolkit:CalendarExtender ID="Calendar1" runat="server" TargetControlID="txtFrom" Format="dd.MM.yyyy" Enabled="true" PopupButtonID="image1" CssClass="cal_Theme1"></ajaxToolkit:CalendarExtender>

    Web.config :

    <configuration>
      <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
      <connectionStrings>
        <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-RechnungProgramm-20140827102620.mdf;Initial Catalog=aspnet-RechnungProgramm-20140827102620;Integrated Security=True" providerName="System.Data.SqlClient" />
        <add name="RechnungConnectionString" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Rechnung.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
      </connectionStrings>
      <system.web>
        <authentication mode="None" />
        <compilation debug="true" targetFramework="4.5">
          <assemblies>
            <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
          </assemblies>
        </compilation>
        <httpRuntime targetFramework="4.5" />
        <pages>
          <namespaces>
            <add namespace="System.Web.Optimization" />
            <add namespace="Microsoft.AspNet.Identity" />
          </namespaces>
          <controls>
            <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
          <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /></controls>
        </pages>
        <membership>
          <providers>
            <!--
              ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
            -->
            <clear />
          </providers>
        </membership>
        <profile>
          <providers>
            <!--
              ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
            -->
            <clear />
          </providers>
        </profile>
        <roleManager>
          <!--
                ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
            -->
          <providers>
            <clear />
          </providers>
        </roleManager>
        <!--
                If you are deploying to a cloud environment that has multiple web server instances,
                you should change session state mode from "InProc" to "Custom". In addition,
                change the connection string named "DefaultConnection" to connect to an instance
                of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
          -->
        <sessionState mode="InProc" customProvider="DefaultSessionProvider">
          <providers>
            <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
          </providers>
        </sessionState>
      </system.web>
      <system.webServer>
        <modules>
          <remove name="FormsAuthenticationModule" />
        </modules>
        <handlers>
          <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </handlers>
      </system.webServer>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="v11.0" />
          </parameters>
        </defaultConnectionFactory>
        <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
      </entityFramework>
    </configuration>

    and master page ScriptManager :

    <form runat="server">
                <ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true"
                        EnableScriptLocalization="true" ID="ScriptManager1" ScriptMode="Debug" CombineScripts="false" >
                <Scripts>
                    <%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%>
                    <%--Framework Scripts--%>
                    <asp:ScriptReference Name="jquery" />
                    <asp:ScriptReference Name="bootstrap" />
                    <asp:ScriptReference Name="respond" />
                    <asp:ScriptReference Name="WebForms.js" Path="~/Scripts/WebForms/WebForms.js" />
                    <asp:ScriptReference Name="WebUIValidation.js" Path="~/Scripts/WebForms/WebUIValidation.js" />
                    <asp:ScriptReference Name="MenuStandards.js" Path="~/Scripts/WebForms/MenuStandards.js" />
                    <asp:ScriptReference Name="GridView.js" Path="~/Scripts/WebForms/GridView.js" />
                    <asp:ScriptReference Name="DetailsView.js" Path="~/Scripts/WebForms/DetailsView.js" />
                    <asp:ScriptReference Name="TreeView.js" Path="~/Scripts/WebForms/TreeView.js" />
                    <asp:ScriptReference Name="WebParts.js" Path="~/Scripts/WebForms/WebParts.js" />
                    <asp:ScriptReference Name="Focus.js" Path="~/Scripts/WebForms/Focus.js" />
                    <asp:ScriptReference Name="WebFormsBundle" />
                    <%--Site Scripts--%>
                </Scripts>
                </ajaxToolkit:ToolkitScriptManager>

    using AjaxControlToolkit.dll Version 4.5.7.1213 , and i checked AjaxControlToolkit dll was in the bin folder 

    How can i fix this ?

    Friday, May 1, 2015 2:58 AM

Answers

  • User1711366110 posted

    I am using the AjaxControlToolkit CalendarExtender in my web site and its working in the visual studio 2012 but after publish to IIS Calendar Extender control won't show !
     

    As per this case, I have shared my ideas below :

    1.Only Ajax calendar extender was not working or all ajax controls are not working when publish in iis .
    If that is the case, you can modify the version 4.0.0.0 into your ajax version (4.5.7.1213)  in web.config like below :

    <system.webServer>
        <modules>
          <remove name="FormsAuthenticationModule" />
        </modules>
        <handlers>
          <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd"             
    type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
    Version=4.5.7.1213
    , Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </handlers> </system.webServer>

    2. Or you can change the date format in CalendarExtender from "dd.MM.yyyy" into standard format "yyyy/MM/dd"  or "MM/yyyy/dd"  like below :

    <ajaxToolkit:CalendarExtender ID="Calendar1" runat="server" TargetControlID="txtFrom"                    
    Format="yyyy/MM/dd"

    Enabled="true" PopupButtonID="image1" CssClass="cal_Theme1"></ajaxToolkit:CalendarExtender>

    3.or you can set the corresponding attribute value like (EN-GB) in Localization language for "dd/MM/yyyy" like below :

    <ajaxToolkit:CalendarExtender ID="Calendar1" runat="server" TargetControlID="txtFrom" 
                      Format="dd/MM/yyyy" 
                      Enabled="true" PopupButtonID="image1" CssClass="cal_Theme1"></ajaxToolkit:CalendarExtender>

    In web.config

    <globalization culture="en-GB"/>

    --
    with regards,
    Edwin

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 3, 2015 11:51 PM