Saturday, March 24, 2012

Wrapping a custom control for AJAX

I have a custom control the renders a list/grid based on a specialized datasource. All of the heavy lifting is done in OnRender, where I use the HtmlTextWriter to output raw html. I do this because the nature of the containing pages dictates that I render as late and as efficiently as possible. I have implemented this control in a large number of areas across several applications.

Now I am interested in upgrading those applications to use the ASP.NET AJAX framework. The problem is, none of my custom list controls behaves properly inside an UpdatePanel. I believe this is because the controls are rendered late and rendered as straight HTML.

My question is: What are my options on getting this control to behave itself? Obviously the "re-write the control" route is my last option (not because of the time to rewrite, but because of the time to regression test hundreds of implementations of the control). Is there an elegant way to wrap or subtly modify the control such that containers won't necessarily know that it has changed, and still have it perform client-side post backs and in-place updates? I'm open to all suggestions. I'm not a neophyte on this stuff; I've been using the XMLHttpRequest object to do in-place updates for years. But this one has me a little stymied on the practicality of a solution.

I appreciate any help.

Thanks,

Jason

My only solution for you is using the XMLHttpRequest object to do updates:(

I'll think about it tomorrow,Maybe I can provide you with a better solution.

Thanks

No comments:

Post a Comment