Scott Hanselman

Ajax Control Toolkit July 2011 Release - Now on NuGet

August 10, 2011 Comment on this post [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
Hosting By
Hosted in an Azure App Service
August 10, 2011 3:00
I only wish that they fixed the bug with MaskedEdit and Chrome Backspace
August 10, 2011 3:16
It's been a while since I last seen a runat="server", and I don't miss it a bit :)
August 10, 2011 3:25
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!
August 10, 2011 4:24
What would be your back of the hand prognosis for using the HtmlEditor in mvc, without sacrificing to much mvcness.
August 10, 2011 4:30
Erick - Totally. It's clientside JS. You could totally do that.
August 10, 2011 11:48
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?
August 10, 2011 13:49
Sounds good. Great that you havn't forgotten ASPX....there are still many projects out there :)
August 10, 2011 14:39
Message "10 August 2011 00:48:20 (Pacific Daylight Time, UTC-07:00)" posted by me - not sure what happened to my name.
August 10, 2011 18:04
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"?
August 11, 2011 1:16
Could you please show the use of HTML Editor in MVC ?
Thank you,
August 12, 2011 11:19
@Ignat "Could you please show the use of HTML Editor in MVC ?" Seconded.
August 25, 2011 22:06
Just using JQuery is good enough. JQuery UI and its plugins and widgets.
December 31, 2011 14:33
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

Comments are closed.

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