P
Patrick Ruzand
Hello,
I have developed a custom ASP.NET WebControl and I am now testing a possible
Atlas integration, to take advantage of the UpdatePanel partial refresh.
My WebControl subclass consists on a simple control that renders itself as
an <img> tag with an associated <imagemap>, the imagemap being used to
provide tooltips. Coupled with this img, it adds an OnClick event handler
that performs some hidden field initialization and then calls
myform.submit(). That's it for my control.
To test Atlas UpdatePanel features, I have added my control to the
ContentTemplate of an UpdatePanel. Unfortunately, with no success: when I
click on my image, the full page is loaded.
After some investigations, it happens that, from what I have understood, the
whole async postback mechanism relies on the form.onsubmit event. At least,
that's what I deduced from the PageRequestManager.OnFormSubmit event handler.
Which explains the problem I am facing: because calling form.submit does not
raise onsubmit event, the PageRequestManager.OnFormSubmit is never called
when I click on my image and the page is fully reloaded.
To be sure the problem came from here, I replaced the call to
'myform.submit' by:
PageRequestManager.getInstance()._onFormElementClick(a_Sys_UI_DomEvent);
PageRequestManager.getInstance()._onFormSubmit(a_Sys_UI_DomEvent);
and it works.
So, what is the proper methodology to trigger an async postback in such a
configuration ? Is there a way to manually trigger an onsubmit ?
(changing the <img> tag with an <input type="image"> and removing the
explicit call to 'myform.submit' is not a solution. In this configuration, it
works fine, but the problem is the imagemap is then lost (not taken into
account by thr browser with an 'input' image)).
Thanks a lot for your help,
Patrick
I have developed a custom ASP.NET WebControl and I am now testing a possible
Atlas integration, to take advantage of the UpdatePanel partial refresh.
My WebControl subclass consists on a simple control that renders itself as
an <img> tag with an associated <imagemap>, the imagemap being used to
provide tooltips. Coupled with this img, it adds an OnClick event handler
that performs some hidden field initialization and then calls
myform.submit(). That's it for my control.
To test Atlas UpdatePanel features, I have added my control to the
ContentTemplate of an UpdatePanel. Unfortunately, with no success: when I
click on my image, the full page is loaded.
After some investigations, it happens that, from what I have understood, the
whole async postback mechanism relies on the form.onsubmit event. At least,
that's what I deduced from the PageRequestManager.OnFormSubmit event handler.
Which explains the problem I am facing: because calling form.submit does not
raise onsubmit event, the PageRequestManager.OnFormSubmit is never called
when I click on my image and the page is fully reloaded.
To be sure the problem came from here, I replaced the call to
'myform.submit' by:
PageRequestManager.getInstance()._onFormElementClick(a_Sys_UI_DomEvent);
PageRequestManager.getInstance()._onFormSubmit(a_Sys_UI_DomEvent);
and it works.
So, what is the proper methodology to trigger an async postback in such a
configuration ? Is there a way to manually trigger an onsubmit ?
(changing the <img> tag with an <input type="image"> and removing the
explicit call to 'myform.submit' is not a solution. In this configuration, it
works fine, but the problem is the imagemap is then lost (not taken into
account by thr browser with an 'input' image)).
Thanks a lot for your help,
Patrick