locked
Ajax Control ToolKit Installation Problems RRS feed

  • Question

  • User1692004701 posted

    Hi,

    I am really sorry to post this but I have tried what I beleive is every solution I can find to this issue and I still cannot get this working - it will probably be something very basic that I am missing so apologies in advance.

    I am using VS 2008 (2010 is on its way but not available to me yet) and working on an existing asp.net website was is quite old now, I beleive it was previously configured under .net 2.0, I have updated the configuration to 3.5.

    I would like to use some of the ajax controls on this site so decided to follow the incredibly simple instructions for downloading the toolkit and installing. I beleive I have followed the process to the letter but any site I try to use the ajax controls within I get errors like this:

    Warning 1 Element 'ToolkitScriptManager' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. 

    Both my existing site and if I create a brand new web project and then try to include the Ajax controls.

    I have the following line in my Default.aspx file (I didnt put it there):

    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

    The AjaxControlToolkit.dll file exists in the project Bin directory and the site contains a reference to AjaxControlToolkit as well.

    I can see all of the Controls in the VS ToolBox view e.g. ToolkitScriptManager but when I drag one on to the page I get the above error.

    I've tried adding assembly and control tags to the web.config file but no joy - still get the same errors e.g.

    <add assembly="AjaxControlToolKit, Version=3.5.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    I got the version number from the properties of the AjaxControlToolKit reference in VS - it seems to be correct because if I modify it at all and rebuild I get the following error:

    ASP.NET runtime error: Could not load file or assembly 'AjaxControlToolKit, Version=3.5.1.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Notice here I have changed the 7 to a 1 ... this suggest to me that the dll I have is intact and VS is recognising it correctly - that along with the fact that I can expand the AjaxControlToolKit reference in my web project and see all of the components.

    I have also tried various combinations of entries in the web.config and Register settings in the .aspx file - nothing will work.

    Any help would really, really be appreciated - be gentle though, I'm new to this (as you could probably tell!).

    Thanks in advance,

    Paul

    Friday, January 17, 2014 6:51 PM

Answers

  • User1692004701 posted

    I finally sorted this - still dont know why it worked but it has.

    After persisting with the debugging further I converted my ScriptManager tag to a toolkitscriptmanager I then got a different run time error complaining about AjaxMin buried somewhere in the stack. I rembered seeing this dll in the download from the tool kit so I added this and the other two random dll's that came with the download as references in my site and now the errors have cleared.

    What I find mystifying is that nowhere in any set of instructions that I have read does it suggest I need to use this dll - it only ever mentions the AjaxControlToolkit.dll and adding that to the bin directory and as a reference.

    If anyone can shed any light on this it would be useful.

    Also, I still cant get the tagPrefix to work through the web.config file only, it only works when I add the Regsiter line in the aspx file itself, despite having the <control> tag in the web.config mentioned above - is this normal?

    Thanks

    Paul

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 18, 2014 4:52 AM

All replies

  • User1692004701 posted

    Hi,

    Thanks for your response.

    I already have the Ajax Controls visible in VS 2008 and referenced in my project.

    When I drag one of the controls on to the page VS complains:

    Warning 1 Unrecognized tag prefix or device filter 'ajaxToolkit'

    I have the following in my web.config

    <add tagPrefix="ajaxToolkit" namespace="ajaxControlToolkit" assembly="AjaxControlToolkit, Version=3.5.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    I have the following in the aspx page itself which gets added by VS when I drop an Ajax control onto the page.

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

    I have built, rebuilt, waited etc. no joy, restarted VS / IIS still nothing.

    I can run the page in this state but I get a runtime error:

    Microsoft JScript runtime error: 'Sys.Extended.UI' is null or not an object

    When I debug this it takes me straight to the following line which is the Ajax Control I am trying to add:

    $create(Sys.Extended.UI.ModalPopupBehavior, {"BackgroundCssClass":"ModalPopupBG","CancelControlID":"btnCancel","Drag":true,"OkControlID":"btnOkay","PopupControlID":"Panel1","PopupDragHandleControlID":"PopupHeader","dynamicServicePath":"/Default.aspx","id":"ModalPopupExtender1"}, null, null, $get("Button1"));

    This stuff sounds so easy and yet is proving incredibly difficult!

    Any ideas?

    Thanks again,

    Paul

    Saturday, January 18, 2014 3:51 AM
  • User1692004701 posted

    I finally sorted this - still dont know why it worked but it has.

    After persisting with the debugging further I converted my ScriptManager tag to a toolkitscriptmanager I then got a different run time error complaining about AjaxMin buried somewhere in the stack. I rembered seeing this dll in the download from the tool kit so I added this and the other two random dll's that came with the download as references in my site and now the errors have cleared.

    What I find mystifying is that nowhere in any set of instructions that I have read does it suggest I need to use this dll - it only ever mentions the AjaxControlToolkit.dll and adding that to the bin directory and as a reference.

    If anyone can shed any light on this it would be useful.

    Also, I still cant get the tagPrefix to work through the web.config file only, it only works when I add the Regsiter line in the aspx file itself, despite having the <control> tag in the web.config mentioned above - is this normal?

    Thanks

    Paul

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 18, 2014 4:52 AM
  • User555306248 posted

    Hi,

    Please make sure you add the follow code in your page:

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

    Remove DLL and reference of Ajax dll, add reference again. Add the controls to toolbox by using Choose Item option on Toolbox. Drag the controls to page in design mode.
    This will automatically update page and web.config references.

    http://stackoverflow.com/questions/1474716/resolving-validation-element-xxxx-is-not-supported-warning-in-visual-stud

    Sunday, January 19, 2014 10:40 PM