Reputation: 581
The majority of all other issues ive read about the AJAX Toolkit not working is related to some form of error that populates. I do not have an error I can reference! Which makes this bug a little harder to understand. I have a feeling I am missing ONE step. Ive gone through all the documentation and it shows that I am doing everything correctly.
The Issue: I am trying to use a calendar extender on a textbox (which I have read that I no longer need to but that is aside the point). When I go to click on said textbox to make sure the toolkit is working, no calendar pops up!
The Double-Check: To check to see if it is the calendar itself (again, read that it was no longer needed) I added a confirm button extender to test the toolkit. It doesn't work either.
What have I done so far? I have: installed/reinstalled using NuGet the lastest version of the Ajax Control Toolkit (7.1213), commented out the registry in web.config and added to top of page (and visa versa), restarted VS2012 with every uninstall/reinstall, tried pulling syntax straight from the toolbox (which was taken from ajaxcontroltoolkit.dll) instead of hand-typing.
The Code:
web.config (added by NuGet on installation)
...
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4" />
</dependentAssembly>
</assemblyBinding>
</runtime>
...
page1.aspx
...
<%--patient ID panel--%>
<asp:Panel ID="pat_id_pnl" runat="server">
<div align="center">
<asp:Label runat="server" Text="SSN/MRN:" />
<asp:TextBox ID="ssn_mrn_txt" runat="server" style="margin-left:5px; margin-right:15px;"/>
<asp:Label runat="server" Text="Date of Appt:" />
<asp:TextBox ID="date_appt_txt" runat="server" style="margin-left:5px; margin-right:15px;"/>
<%--add calendar to date_appt_txt--%>
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="Server" />
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="date_appt_txt" Format="MM/dd/yyyy" />
<asp:Button ID="search_btn" runat="server" Text="Search" />
<%--Test confirm button extender--%>
<ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="Are you sure you want to click this?" TargetControlID="search_btn"></ajaxToolkit:ConfirmButtonExtender>
</div>
</asp:Panel>
....
The line I was referring to earlier when I said "commented out the registry in web.config and added to top of page" I meant I commented this out of the web.config:
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
and added this to the top of the page before the first content place holder:
<%@ Register tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" %>
Any help is greatly appreciated! Thanks.
Upvotes: 0
Views: 3110
Reputation: 581
So I figured a few things out after more searching.
To see an error with the ajax control toolkit, debug in internet explorer. Once I stopped debugging in chrome, I caught an error that said:
...AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts...
I had to remove Microsoft.Scriptmanager.MSAjax.dll
from the bin folder of the project
That fixed my issue! Hope that it helps.
Upvotes: 1