Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Patrick Ruzand #1
[Atlas Beta1] how to manually trigger an async postback
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()._onFormElementCli ck(a_Sys_UI_DomEvent);
PageRequestManager.getInstance()._onFormSubmit(a_S ys_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
Patrick Ruzand Guest
-
Atlas and VS2003!!!
is there any way to create an asp.net control in VS2005 and then use it by any means in VS2003 ?? is there a way to acheive this by any means... -
Atlas not working properly after my control is added
I have a Web Control that is affecting the correct functioning of Atlas and I don't know why. I put together a very small sample control along with... -
asp:fileupload within Atlas Update Panel
I am having problems retireving the file information when you place an asp:fileupload control inside an Atlas UPdate Panel. Has any body got a... -
Problems with Flex 2.0 beta1
Hi all, i was running my Flax 2.0 beta1 but from one day to another this problem occured: "c:\windows\system32\macromed\flash\flash8a.ocx You... -
Async db calls in CF5?
We have encountered an issue with some very-long-running stored procedures, and one of the possibilities I was asked to look at is whether it is... -
Steven Cheng[MSFT] #2
RE: [Atlas Beta1] how to manually trigger an async postback
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.
Also, as you mentioned the following code snippet
==============
PageRequestManager.getInstance()._onFormElementCli ck(a_Sys_UI_DomEvent);
PageRequestManager.getInstance()._onFormSubmit(a_S ys_UI_DomEvent);
==============
Are you doing any customization on the updatepanel page's postback?
BTW, from the title, you're using the latest beta1 version of the
ATLAS(ASP.NET AJAX) package, correct?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
[url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif[/url]
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
[url]http://msdn.microsoft.com/subscriptions/support/default.aspx[/url].
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] Guest
-
Patrick Ruzand #3
Re: [Atlas Beta1] how to manually trigger an async postback
Hello Steven,
In fact, I am investigating how our WebControl developped in ASP.NET 1.0> 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.
>
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.
yes, this is the only workaround I found for the time being, calling> Also, as you mentioned the following code snippet
>
> ==============
> PageRequestManager.getInstance()._onFormElementCli ck(a_Sys_UI_DomEvent);
> PageRequestManager.getInstance()._onFormSubmit(a_S ys_UI_DomEvent);
> ==============
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.
When the user click on my control (the <img> in the rendered html), it posts> Are you doing any customization on the updatepanel page's postback?
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>.
Yes, that's correct.> BTW, from the title, you're using the latest beta1 version of the
> ATLAS(ASP.NET AJAX) package, correct?
Thanks,
Patrick
Patrick Ruzand Guest
-
Steven Cheng[MSFT] #4
Re: [Atlas Beta1] how to manually trigger an async postback
Thanks for your reply Patrick,
I'll have a look and perform some further research. I'll update you if I
get any new information.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] Guest
-
Steven Cheng[MSFT] #5
Re: [Atlas Beta1] how to manually trigger an async postback
Hi Patrick,
After some further investigation, I'm afraid so far I haven't found any
other better means on this. Does your current workaround fit the scenario,
if so, you can continue using it now. Also, I would suggest you post
request to the AJAX forum in [url]WWW.ASP.NET[/url] site since there some web UI
team's engineer there.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] Guest
-
Patrick Ruzand #6
Re: [Atlas Beta1] how to manually trigger an async postback
> Hi Patrick,
Thanks Steven. I'll see whether the workaround I found might be>
> After some further investigation, I'm afraid so far I haven't found any
> other better means on this. Does your current workaround fit the scenario,
> if so, you can continue using it now. Also, I would suggest you post
> request to the AJAX forum in [url]WWW.ASP.NET[/url] site since there some web UI
> team's engineer there.
used in the final product.
Also, being currently in Barcelona for MS TechEd Developer, I'll
try to catch an Atlas engineer and see if there are other ways.
Thanks for your help,
Patrick
Patrick Ruzand Guest
-
Steven Cheng[MSFT] #7
Re: [Atlas Beta1] how to manually trigger an async postback
Hello Patrick,
Thanks for your reply.
If you get any further progress later, please feel free to post here so
that any other members and also reference to it.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] Guest
-
Patrick Ruzand #8
Re: [Atlas Beta1] how to manually trigger an async postback
> Hello Patrick,
Thanks to the great Atlas team at TechEd, my problem is eventually solved.>
> Thanks for your reply.
>
> If you get any further progress later, please feel free to post here so
> that any other members and also reference to it.
Actually, the issue was that I was doing the submit in the old ways,
that is calling form.submit().
In ASP.NET, you should not call the submit() method because doing this,
you bypass the ASP postBack mechanism. Instead, you should
call the PostBack event handler reference.
In my case, the javascript code generation should be written as:
script.AppendFormat("\t\t"+Page.ClientScript.GetPo stBackEventReference(this,
"")+";{0}", Environment.NewLine);
where 'script' is a StringBuffer containing the javascript code generated
by my WebControl.
And then all works fine.
Thanks,
Patrick
Patrick Ruzand Guest



Reply With Quote

