I posted an initial version of my UpdateControls package - a set of ASP.NET AJAX server controls that build on the partial rendering model to extend the model beyond basic page updates. The package consisted of the UpdateHistory and the AnimatedUpdatePanel controls. Theres been quite a few downloads of it, and quite a few comments as well, including bug reports.
If this is the first time you're reading about this, check out my previous blog post on this first and then come back here to see whats changed. Various bugs that have been reported have been fixed including:
- Support for installing to the GAC: The assembly is now signed, and you can add to the GAC if you like, or leave it in the bin directory of your Web application if you can't or don't want to.
- Support for master page and user control scenarios: The UpdateHistory control now works in either of those scenarios. Remember you can still only have one UpdateHistory control on your page.
- Support for bookmarking: Bookmarking was broken ... doh! The ability to bookmark and return to specific views of a page is a key scenario for the UpdateHistory control, and is now fixed.
- Support for debug ASP.NET AJAX scripts: The UpdateHistory control is non-visual, however the framework expects there to be a matching element as it causes post-backs upon back/forward navigation, so I've made minor changes, so as to avoid the debug assert raised by the framework.
In addition to fixing the bugs, I've added a new control to the pack in v1.1 - UpdateAction. As the name might suggest, it enables you to perform a small selection of actions as part of a partial rendering or async postback. Specifically it currently allows you to show a message, set focus on a particular control, or scroll the page to a particular control. The usage is straightforward, and the download contains a sample. Here are the basics:
Step 1 is to add an instance of this control to your page.
<nStuff:UpdateAction runat="server" id="updateAction" />
Step 2 is to call APIs on this control from appropriate event handlers on the page. In the samples I have a DropDownList control, and demonstrate conditionally performing certain actions when a certain item is selected. To that end, you might have something like this:
private void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) {
if (DropDownList1.SelectedIndex == 2) {
updateAction.ShowMessage("You selected the magic item");
updateAction.SetFocus(someControl);
updateAction.ScrollTo(someControl, ScrollOffset.Bottom);
}
}
Thats basically it. Do you think these are useful actions? Any others that are interesting?
You can download the control package, sources and associated samples here for free. I have a couple more ideas in mind for a future iteration of this package, and suggestions are always welcome, in addition to continued feedback on the existing controls.
Posted on Friday, 4/13/2007 @ 4:14 PM
| #
ASP.NET