Welcome Guest Search | Active Topics | Sign In | Register

Callback - server-side response to client-side Options
Eyal
Posted: Wednesday, December 19, 2007 4:42:03 AM
Rank: Newbie
Groups: Member

Joined: 11/26/2007
Posts: 8
Hi,

I'm using the CallbackPanel and trigger the callback with eo_Callback javascript function. The controls within the CallbackPanel are dynamically created.

The server-side code is executing well (suppose), but how can I initiate a response back to the client-side function (with specific parameters) in order to update the dynamically created control?
I appreciate if you could provide a short sample of the implementation of the server-side response initiation and the client-side after-execute function.

Thanks in advance!

Eyal
Finland
eo_support
Posted: Wednesday, December 19, 2007 7:26:21 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

There are a number of ways to do this. One way is to simply render a chunk of JavaScript. For example:

Code: HTML/ASPX
<eo:CallbackPanel runat="server" id="CallbackPanel1">
    ....other contents....
    <asp:Label runat="server" id="lblScript"></asp:Label>
</eo:CallbackPanel>


On the server side, you can do:

lblScript.Text = "<script type=\"text/javascript\">window.alert('hi!');</script>";

Once this code is executed, the CallbackPanel will execute the JavaScript you rendered (in this case window.alert('hi!');).

Thanks
Eyal
Posted: Thursday, December 20, 2007 1:05:09 AM
Rank: Newbie
Groups: Member

Joined: 11/26/2007
Posts: 8
Good point. Thanks! Applause

Quote:
There are a number of ways to do this.

Can you shortly elaborate on other ways?

Thanks again!
eo_support
Posted: Thursday, December 20, 2007 5:51:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Other ways include rendering html input element, using our CallbackPanel's ClientSideAfterExecute event handler, etc.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.