Search code examples
asp.netgridviewajaxcontroltoolkitmodalpopupextender

It's possible to Bind/Populate/Load a GridView when the modalPopUpExtender shows up?


I have 2 update panels.

The second one have a GridView native control and it's wrapped by a panel control. This last panel control has an ModalPopUpExtender from AjaxControlToolkit.

I can bind the data to the gridView at the load event page, and it works just fine inside the update panel with the modalPopUpExtender.

But is there anyway to bind or bind again the GridView when the ModalPopUpExtender shows up ?

I want to do this to let the webpage load faster, and to avoid ask to the user for the item is looking for, and alos, in case the search depends on some user input, I believe is not possible but I just ask to be sure.

My regards.

Ref: To work with ModalPopUp+UpdatePanel+Grid I follow this sample:http://weblogs.asp.net/rajbk/archive/2009/05/07/using-the-modal-popup-extender-to-build-a-popup-search-interface.aspx


Solution

  • Bind when you show the ModalPopupExtender, not by using the UpdatePanel, since the show event is a client-side event. However, you could have a button that appears saying "Load Data" that they can click on to get the results, which is an extra click but would work. Or, if you can get the results via JSON, you can build the display on the client using JavaScript, which would also be efficient.