问题
I've got a modal popup (using ModalPopupExtender) working in a kind of master/detail view for a grid. When you click a button on one grid, it displays a popup window containing another grid of information, based on the row clicked in the first grid.
This works well... I've enabled editing in the grid that is popped up. When you click edit though, the popup window disappears. If I click the display button in the first grid though to bring the popup window visible again it displays, and is now in edit mode.
Is there a way to make postbacks in the popup not close the popup?
回答1:
Figured out a way to do this...
In the row command event for the gridview I just called Popup() for my modalpopup.
Works :)
回答2:
I usually put an UpdatePanel around my ModalPopup contents. That way, everything that happens in the popup can be updated without doing a full page reload. It also makes it so that clicking "back" in the browser doesn't page through each thing that you did in the popup.
来源:https://stackoverflow.com/questions/2380736/edit-a-gridview-inside-a-modalpopup-without-closing-popup