1
我想一些Ajax控件添加到我的網頁:添加參考AjaxControlToolkit到web.config文件
<asp:Button runat="server" ID="lnkDelete" CommandName="DeleteCity" CssClass="rowbutton" CommandArgument='<%# Eval("cityid") %>' Text="Delete" />
<ajax:ConfirmButtonExtender runat="server" ID="confirm_Delete" TargetControlID="lnkDelete" ConfirmText="Deleting a city will delete all Suburbs, DICs and Appointments associated with it. Do you want to continue?">
</ajax:ConfirmButtonExtender>
我已經檢查了SO一對夫婦的問題,我發現this爲好,但仍然沒有運氣讓頁面接受新的標籤。
當我在註冊頁面級別AjaxControlToolkit,它工作,但是當我把它添加到web.config文件,但它仍然無法找到服務器標籤:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>`) it works, but I'd rather not do this for every page that I need to use ajax on.
注:註冊這種方式如果在母版頁上完成則不起作用。
我有以下的在我的web.config文件:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<customErrors mode="Off" />
<pages styleSheetTheme="Default">
<controls>
<add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
</controls>
</pages>
</system.web>
</configuration>
難道我做錯了什麼?在這裏做正確的方法是什麼?
在情況下,它可能是重要的,我使用AjaxControlToolkit版本4.1.51116