开发者

ASP.NET AJAX: How can I send information to the client from server-side

The page has already run its' initialise/load sequences etc but then catches an event. How can I then send value(s) from this event to the client.

That probably 开发者_JAVA百科doesn't make much sense, hopefully this will clarify:

I have a grid (Telerik RadGrid) in a user control (A) and when the user selects a row in that grid, I want to update another user control (B) with the selection.

I have wired up an event so that user control B is notified of the newly selected value however setting say a textbox value in user control B server-side isn't rendering (I'm presuming because the grid selection is happening over AJAX and therefore user control B never re-renders?).

So, how can I either force user control B to re-render with the updated values or how can I send these values to the client using an AJAX like call? Or am I going about this the wrong way entirely. The core question really is how can I get data from user control A to user control B when the page isn't being posted back.

Thanks!


There are ways to push data from the server (one is called "long polling") but this does not apply here. Are you sure that your grid event fires and the event handler executes? If you are, and you update control (B) but the change does not appear, put control (B) or both into an asp:UpdatePanel and call the Update() method on it in the event handler after changing the value. This will trigger another Ajax postback that should refresh your control.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜