Ortund
Ortund

Reputation: 8245

Adding reference to AjaxControlToolkit to web.config file

I'm trying to add some ajax controls to my page:

<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.&#10;Do you want to continue?">
</ajax:ConfirmButtonExtender>

I've checked a couple of questions on SO and I found this as well, but still not having any luck getting pages to accept the new tag.

When I register the AjaxControlToolkit on Page level, it works, but when I add it to the web.config file, it still can't find the server tag:

<%@ 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.  

Note: Registering this way doesn't work if it is done on the master page.

I have the following in my web.config file:

<?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>

Have I done something wrong? What's the right way to do it here?

In case it might be important, I'm using AjaxControlToolkit version 4.1.51116

Upvotes: 1

Views: 26621

Answers (1)

Ortund
Ortund

Reputation: 8245

Turns out simply rebuilding the solution sorted this one out.

I persisted the change to add the reference into the web.config file and rebuilt the solution.

Everything works okay now

Upvotes: 1

Related Questions