views:

172

answers:

1

Hi,

I have an ajax modal panel with a div on it that I access from the server and dynamically insert a table into, by showing the values of various controls on the calling form.

My problem is this, it works fine if all my controls are doing auto postback, but it ruins the user experience, because tabbing through the controls, the controls lose focus during the automatic postback.

Is there a way to have my target control perform a postback, before it puts up the modal, so I can retrieve not posted controls data in the modal? It still has to put up the modal.

Any insights would be appreciated!

Thanks, John.

+1  A: 

Hey John,

I'm a little confused. Do you mean a modal popup, or an AJAX UpdatePanel?

Either way, it sounds like your use case here may be more complex than out-of-the-box AJAX is able to handle. Your best bet may be a custom ICallBackEventHandler or IPostBackEventHandler operation.

Funnel all of your calls/postbacks through a single client-side function (JavaScript, et al.), grab necessary control state, send it to the server, and use the results to update your page. There are pretty decent examples in MSDN Library for all this. (See: MSDN Library)

Hope this helps!

Nate

Nathan Southerland