Building Rich Internet Applications With ASP.NET AJAX Control Toolkit
ASP.NET AJAX Control Toolkit
ACT is run both by Microsoft and community, so everybody can take part in the creation of the decent AJAX toolkit.
The installation isn't difficult, but still worth mentioning.
First, you need to download the kit, go to their CodePlex page and choose the appropriate package. After downloading unpack the contents of the archive somewhere. Open Visual Studio, expand Toolbox, right-click, choose "Add Tab", name it "AJAX Control Toolkit", then right-click again within the space of the newly created tab and select "Choose Items...", click "Browse", open the folder where you extracted the contents of the archive, open "SampleWebsite\Bin\AjaxControlToolkit.dll". The tab must become populated with the controls. If you drag any control to a web form, the necessary assemblies will be copied to the "Bin" folder of the web site and the ACT assembly will also got registered on the page.
ACT provides two type s of controls:
- Web controls
Web controls are just ordinary ASP.NET controls with some enhanced client-side functionality
Extenders are controls built on top of the existing ASP.NET controls with an additional client-side functionality, for example, many controls, for instance Slider, use TextBox and store their value in it.
The full list of controls is:
- Numeric controls
- Text input
- Drop down
- Panels and tabs
- Buttons and check boxes
Enough with the theory, let's do something practical, for example, let's try the Slider control.
Drag Slider from Toolbox onto your page.
Since, Slider is an extender and it extends TextBox, you should add a TextBox and add the TargetControlID attribute to the Slider:
<asp:TextBox ID="txtSlider" runat="server" /> <cc1:SliderExtender ID="SliderExtender1" runat="server" TargetControlID="txtSlider" />
Don't forget to add ScriptManager to the page, because the page won't compile without it. You can compile it now and drag the slider. Unfortunately, it doesn't show the current value. You need to add a bound control, add Label next to the TextBox and set the BoundControlID of the SliderExtender:
<asp:TextBox ID="txtSlider" runat="server" /> <asp:Label ID="lblSlider" runat="server" /> <cc1:SliderExtender ID="SliderExtender1" runat="server" TargetControlID="txtSlider" BoundControlID="lblSlider" />
Now when sliding it you can see the value.
You can set the minimum value with the Mininum attribute, the maximum value with the Maximum attribue and the number of steps with the Steps attribute.
If you need to add some rich functionality to your web application, then you should consider using ASP.NET AJAX Control Toolkit that is still in its community sandbox, however as many projects that were marked as beta it can be shipped with the new versions of Visual Studio and become an integrated part of the further .NET Framework releases.
I recommend you to check this page where you can find all the examples and the documentation of every control available in the kit.