Showing posts with label wrapping. Show all posts
Showing posts with label wrapping. Show all posts

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

Wednesday, March 21, 2012

Wrapping a Login control with an UpdatePanel

Hi All,

This is my first ATLAS experiment. I'm trying to warp a Login control with an UpdatePanel. It seems that putting the UpdatePanel inside a template is not possible, which leaves me with the option of putting the Login control inside the ContentTemplate of the UpdatePanel instead. However, this results in the TriggerControlEvent not being able to reference the login button (which has to reside within the Login control in order to work, no?)

Kind of a chicken an egg problem it seems. Anyone has an idea how to acheive this behaviour?

Thanks,

Yuval

Just found out that the ControlTriggerEvent is not required, so no problem there.


hello.

1. you don't need a trigger if the control that has an event you want to handle is inside an updatepanel. the panel will detect the postback and treat it accordingly.

2. there are known issues that won't let you put the login control inside an update panel (search the foruns for a complete description of the problem).