ASP.Net Ajax: make sure you check for IsAsync!

I am experimenting with a couple of Ajax controls from the AjaxControlsToolkit. I have read quite a couple of articles about them, but you never know when to apply that knowledge you acquired by browsing around.

Well, today I hit a problem using a CalendarExtender in a FormView on an UpdatePanel:

Selecting the Edit mode of the FormView always raised a Javascript exception stating a Javascript syntax error, and a .js file not being able to be loaded.

After googling around and finding that I am the only one on the planet that experiences that problem, I remembered an article about Ajax traps and handling of asynchronous events.

Continue reading

Handling CollapsiblePanelExtender events in Javascript

I am currently migrating two ASP.Net projects to VS 2005 AjaxControlToolkit.

Of course I had a glance at the samples, and compared the functionality to its open source counterpart, namely Prototype plus Scriptaculous.

When I built a navigation menu using a couple of CollapsiblePanelExtender controls, I ran across two problems:

1) It seems extremely difficult to store the current state of CollapsiblePanelExtenders to be retrieved in the next GET. The simplest solution would be an asynchronous callback from the extender, but that functionality is not included in the framework.

2) I wanted to collapse the whole navigation menu, which is kept inside an HTML table. To keep the table format static, I used a style=”width: 200px” attribute. However, if the navigation menu is to hide, the width should be set to the size of the expanding icon.

Continue reading