Patrick Ruzand
10/31/2006 6:33:00 AM
Hello Steven,
> Hello Patrick,
>
> From your description, I understand you want to integrate the ATALS
> updatepanel feature into your custom web control.
> Based on my understanding, updatepanel is one of the atlas component that
> support partial rendering and updating, however, for custom web control's
> development, you may have to consider the following things:
>
> 1When using ATLAS in asp.net application, you need to configure and deploy
> the ATLAS package in the whole application rather than simply configure in
> your control. Therefore ,your webcontrol will be retricted to ATLAS
> application only.
>
In fact, I am investigating how our WebControl developped in ASP.NET 1.0
could be integrated into the UpdatePanel framework. My WebControl consists
on basically an image plus an imagemap that performs a submit when the
user click on the image.
My first thought was that it would take advantage of the UpdatePanel partial
refresh without modifying my WebControl, just by adding it to an
UpdatePanel's
ContentTemplate, something like that:
....
<asp:UpdatePanel id="updatepanel1">
<ContentTemplate>
<cc1:MyControl .../>
</ContentTemplate>
</asp:UpdatePanel>
....
But it did not work. Indeed, as I told you, my WebControl uses an onClick
event handler to perform some checking/initialization and then calls
form.submit()
explicitely to perform the postback. The problem is that this postback
seems not to be catched by the Atlas PageRequestManager class, the latter
listening the onsubmit event. Since form.submit() does not raise onsubmit
event,
my postback pass through the partial refresh mechanism, and the page is
fully reloaded.
But again this is my understanding, it may be totally wrong.
> Also, as you mentioned the following code snippet
>
> ==============
> PageRequestManager.getInstance()._onFormElementClick(a_Sys_UI_DomEvent);
> PageRequestManager.getInstance()._onFormSubmit(a_Sys_UI_DomEvent);
> ==============
yes, this is the only workaround I found for the time being, calling
explicitely
the Atlas PageRequestManager's functions that are called by the
PageRequestManager's
onsubmit event handler.
In fact, another workaround is to use an <input type=image> instead of an
<img> but
in this case I lose the benefit of the imagemap.
> Are you doing any customization on the updatepanel page's postback?
When the user click on my control (the <img> in the rendered html), it posts
a form.submit(). In response to this submit, my webcontrol performs some
action on the server that may change the appearance of the control, and then
renders
a new <img>.
> BTW, from the title, you're using the latest beta1 version of the
> ATLAS(ASP.NET AJAX) package, correct?
Yes, that's correct.
Thanks,
Patrick