I have a GridView with hyperlinks in some of the columns, which open up a new page in a FancyBox. FancyBox is a pretty cool lightbox alternative. Anyway, in the FancyBox page content you can make changes which will affect values in the parent page’s GridView. So when the FancyBox is closed, I needed to refresh the parent GridView. Here is how you can re-bind the GridView on the Parent Page after FancyBox close:
First I create a button, gave it an OnClick event, and used CSS to make it hidden:
FancyBox has a handy afterClose function which, unsurprisingly, gets calledafter the FancyBox is closed. What it does in here is call the click event of my hidden button:
and then of course, the code behind for the button click event should rebind the gridview!