Ajax Toolkit Calendar无法正常工作

时间:2015-12-09 12:54:33

标签: asp.net ajax ajaxcontroltoolkit

我尝试使用ajax calander扩展器,但它无法正常工作。实际上这个代码正在运行另一种解决方案,但在这个解决方案中它什 这是我的HTML代码

   <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>

 <asp:TextBox ID="txtTalepTarihi" runat="server" placeholder="" class="mid"></asp:TextBox>
                        <ajaxToolkit:CalendarExtender ID="calVerilisTarihi" runat="server" TargetControlID="txtTalepTarihi" Format="dd/MM/yyyy">
                        </ajaxToolkit:CalendarExtender>
                        <asp:Button ID="btnGetir" runat="server" Text="Getir" CssClass="orange myOrangeButton_withLeftMargin" OnClick="btnGetir_OnClick" Style="padding-top: 0px !important" />

这是我的web.config

 <configSections>
 <sectionGroup name="system.web">
      <section name="sanitizer" requirePermission="false" type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit" />
    </sectionGroup>
  </configSections>

system.web>
    <sanitizer defaultProvider="HtmlAgilityPackSanitizerProvider">
      <providers>
        <add name="HtmlAgilityPackSanitizerProvider" type="AjaxControlToolkit.Sanitizer.HtmlAgilityPackSanitizerProvider"></add>
      </providers>
    </sanitizer>
  </system.web>

1 个答案:

答案 0 :(得分:0)

请按照以下步骤操作:

1。从Nuet软件包中添加ajax工具包

2。使用以下代码:

<asp:scriptmanager id="ScriptManager1" runat="server" ></asp:scriptmanager>
<asp:TextBox ID="txtStudentDOB" runat="server" type="text">
<span id="calendarIcon"><i class="fa fa-calendar">
<ajaxtoolkit:calendarextender id="CalendarExtender1" runat="server"targetcontrolid="txtStudentDOB" popupbuttonid="calendarIcon"  Format="MM/dd/yyyy">
</ajaxtoolkit:calendarextender>

3。使用ScriptManager避免出现以下错误:“页面上需要ScriptManager才能使用ASP.NET AJAX脚本。”