Scott Hanselman

Ajax Control Toolkit July 2011 Release - Now on NuGet

August 9, '11 Comments [13] Posted in ASP.NET | ASP.NET Ajax
Sponsored By

Say what you will about the Ajax Control Toolkit. Some like it, some don't, but it got 1.15 MILLION downloads last year. Is the ACT dead? Not yet, and there's ongoing work around WebForms, jQuery and an ACT style of programming. More on this soon.

installpackage

There's like 40 different controls in the Ajax Control Toolkit. They continue to be updated and have cross-browser support. The first release this year added IE9 support. This new July 2011 release adds a a new HTML Editor and more complete browser support including (from Stephen Walther's blog):

The HTML Editor Extender works on all modern browsers including the most recent versions of Mozilla Firefox (Firefox 5), Google Chrome (Chrome 12), and Apple Safari (Safari 5). Furthermore, the HTML Editor Extender is compatible with Microsoft Internet Explorer 6 and newer.

How do you use it? Now that the AjaxControlToolkit is in NuGet, it's easy either from the Package Manager Console, or from the GUI.

Installing AjaxControlToolkit from NuGet

You COULD register the AjaxControlToolkit at the top of your page:

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

But the NuGet package already added that to your web.config!

<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>

Although I think the prefix should be "act," so I'll change it. Then, just use the controls on your page in ASP.NET WebForms. For example, here's how you turn a standard TextBox into a Color Picker:

<act:ToolkitScriptManager ID="manager" runat="Server" />
<asp:TextBox ID="txtColorPicker" runat="server" />

<act:ColorPickerExtender TargetControlID="txtColorPicker" runat="server" />

The ToolkitScriptManager only needs to be on the page once.

Textbox turned into a ColorPicker

This is just one example. Check out the dozens of controls at the Ajax Control Toolkit Sample site.

Enjoy!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Tuesday, 09 August 2011 23:00:55 UTC
I only wish that they fixed the bug with MaskedEdit and Chrome Backspace
Tuesday, 09 August 2011 23:16:39 UTC
It's been a while since I last seen a runat="server", and I don't miss it a bit :)
Tuesday, 09 August 2011 23:25:25 UTC
I'm happy for everyone out there who doesn't have to support anything "legacy". However, for those of us in the corporate trenches where we can be lucky if at least NEW projects can be MVC going forward: there are an assortment of applications happily running along still running on "AjaxControlToolkit" that can't be retired/rebuilt just yet.

Having backward compatibility AND nuget is pretty sweet for these types of legacy apps!
Ian Patrick Hughes
Wednesday, 10 August 2011 00:24:09 UTC
What would be your back of the hand prognosis for using the HtmlEditor in mvc, without sacrificing to much mvcness.
Erick
Wednesday, 10 August 2011 00:30:46 UTC
Erick - Totally. It's clientside JS. You could totally do that.
Wednesday, 10 August 2011 07:48:20 UTC
Scott, I wonder if you can answer this question: Is it necessary to use the ToolkitScriptManager with all ACT functionality? I have read that this is the case but we're not using the ToolkitScriptManager on many projects and various ACT functionality is working just fine.

Could it be that some parts of the ACT require the ToolkitScriptManager, while some do not and therefore the documentation advises you always use it?
Wednesday, 10 August 2011 09:49:14 UTC
Sounds good. Great that you havn't forgotten ASPX....there are still many projects out there :)
Wednesday, 10 August 2011 10:39:45 UTC
Message "10 August 2011 00:48:20 (Pacific Daylight Time, UTC-07:00)" posted by me - not sure what happened to my name.
Wednesday, 10 August 2011 14:04:00 UTC
Not trying to be negative, why don't the ACT team just fully participate on jQuery? ACT can still be there but with minimal support. Is jQuery still not good enough or "because I can"?
John Jabot
Wednesday, 10 August 2011 21:16:27 UTC
Could you please show the use of HTML Editor in MVC ?
Thank you,
Friday, 12 August 2011 07:19:28 UTC
@Ignat "Could you please show the use of HTML Editor in MVC ?" Seconded.
Thursday, 25 August 2011 18:06:31 UTC
Just using JQuery is good enough. JQuery UI and its plugins and widgets.
Azhar
Saturday, 31 December 2011 10:33:43 UTC
This is best one article so far I have read online. I would like to appreciate you for making it very simple and easy. I have found another nice post related to this post over the internet which also explained very well. For more details you may check it by visiting this url......
Ajax Toolkit Editor Control in ASP.Net

Thanks
Ashish Pandey
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.