Rank: Member Groups: Member
Joined: 8/29/2007 Posts: 20
|
ASP.NET AJAX's UpdatePanel has an Update() method that allows programmatic refresh of the panel. The EO.CallbackPanel seems to only support updating through triggers. In my scenario I need to call the update programmatically on a CallbackPanel because a control I could link with a trigger will never exist at the time the update needs to be called.
Is there a way to do this with CallbackPanel?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
It does support programmatically triggering the callback via global function eo_Callback. Please see the documentation for details.
|
Rank: Member Groups: Member
Joined: 8/29/2007 Posts: 20
|
If I'm not mistaken, eo_Callback is a javascript function on the client-side, which won't help because it will trigger a callback before the code that's executed is complete. I was asking about a server-side way of imitating the UpdatePanel's Update() method which does the same thing on the server-side.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Please correct me if I am wrong....my understanding is that you wish to be able to trigger an update, but can not do it through the Trigger because the trigger itself is somehow dynamically loaded and did not exist at the very begining. ASP.NET UpdatePanel's Update doesn't seem to be able to server you that purpose. The purpose of the Update method is to enable to you have control to call it or not, in another word, to have the control over whether the output should be applied or not. It is not a matter of whether to trigger it or how to trigger it. The triggering always occurs on the client side.
We offer similar features through ClientSideAfterExecute client side event handler. Inside that event handler you can determine whether you want to apply the update or not, or even to alter the output. That should give you the same controls, if not more, as ASP.NET UpdatePanel's Update offers. However that doesn't seem to help your issue.
As such it is still my understanding that you should be looking into eo_Callback and to call it only when you need to to trigger the update. There are many ways to let the server to determine whether to call a client side Javascript: one of the easiest is to put a Label in the form and then set the Label's text to a script tag:
<script type="text/javascript">eo_Callback("Callback_ID")</script>
When this code is rendered to the client side, the function will be called. To not trigger this code, set the lable's Visible to false.
Thanks
|