views:

148

answers:

2

Hi!

I have a simple question - I use update panel with custom server control inside. I call __doPostBack from javascript and RaisePostBackEvent on the server fires (I implement IPostBackEventHandler). This is client to server call. Could I return data back to the client (after this partial postback)? What is the best way to achieve this?

Thank you!

A: 

Heko, Have you followed the postback in debug mode yet? If you're using IE with client debugging enabled, you may be able to follow the partial postback in both client and server.

MAbraham1
Yes I followed the postback - it works fine. RaisePostBackEvent is void so I can't return data to the client. How can I pass some data back to the client?Example: Client changes some values and partial postback goes to server and update control state on the server. Now I should return a list of new elements (some objects) from server back to client. Any ideas how?Any ideas?
Heko
A: 

I would think that using ScriptManager.RegisterHiddenField or ScriptManager.RegisterStartupScript would be your best bet. Or both? Depends on what sort of elements you are passing back and forth.

einarq
Thank you! I will try both :)
Heko