创建控件时出错 - Calendarextender3未知服务器标记' ajax:CalendarExtender'

时间:2014-10-14 07:09:11

标签: c# ajax calendarextender

当我使用ajax日历时,它显示错误,如“Error Creating Control - Calendarextender3Unknown server tag'ajax:CalendarExtender'”。我可以知道为什么会这样吗?

<%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"   
 tagPrefix="ajax"
%>

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

<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

                <font size="4"><b> EMPLOYEE RESIGNATION</font></b>
                </div>
                <form id="form1" runat="server">

                    <asp:ScriptManager ID="ScriptManager1" runat="server">
                    </asp:ScriptManager>
                        <table class="ui-accordion" align="center">

                            <tr>

                                <td align="left" class="style2">
                                    Delete Date</td>
                                <td >
                                         <asp:TextBox ID="txtDate" runat="server" /> 

                               <ajax:CalendarExtender ID="Calendarextender3" 
         TargetControlID ="txtdate" Format="dd/MM/yyyy" runat="server">    
         </ajax:CalendarExtender> 

                                </td>
                                </tr>
                        </table>

                        </fieldset>
                </form>
</asp:Content>

请帮帮我......

1 个答案:

答案 0 :(得分:0)

我自己找到了这个问题的答案。下载ajax toolkit dll并将其添加到工具箱中。 然后从工具箱中选择toolkitscriptmanager和ajax calanderextender。下面的示例代码

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

 <tr>
 <td align="left" class="style2">
 <asp:Label ID="lb3" runat="server" Text="Delete Date"></asp:Label>
</td>
<asp:TextBox ID="txtto1" runat="server"></asp:TextBox>
 <ajaxToolkit:CalendarExtender ID="CalendarExtender1" TargetControlID 
 ="txtfrom1" Format="dd/MM/yyyy" runat="server">
 </ajaxToolkit:CalendarExtender>  

 </td>
 </tr>
 </form>