How to display GridView from behind an Ajax ModalPopupExtender

Corey Fleig 60 Reputation points
2025-04-09T17:28:38.3566667+00:00

Not sure how to ask this:

I use a gridView inside an AjaxControlkit modalpopupextender. When a row is clicked, I close the popup by calling Hide(), and then execute a method to load data into a different GridView that was behind the popup on the parent page.

But nothing is being displayed. My method loads DataBind(), and visible is true, so I'm not sure what's going on.

Any ideas?

ASP.NET Core Training
ASP.NET Core Training
ASP.NET Core: A set of technologies in the .NET Framework for building web applications and XML web services.Training: Instruction to develop new skills.
60 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pradeep M 7,785 Reputation points Microsoft External Staff
    2025-04-10T03:47:11.6+00:00

    Hi Corey Fleig,

    To ensure the GridView displays correctly after closing the ModalPopupExtender, please make sure that the GridView is rebound and made visible during the same server-side postback that hides the modal. Avoid placing the data-binding logic inside a Not Page.IsPostBack block, as this can prevent it from executing during postbacks. 

    Additionally, confirm that both the modal and the GridView are placed within the same

    asp:UpdatePanel (or within properly coordinated update panels) to ensure that AJAX partial updates function as expected. 

    If you're using client-side JavaScript (mpe.hide()) to close the modal, be sure that a postback is triggered afterward so the GridView can refresh appropriately. 

    If the issue continues, we recommend sharing more detailed information along with your relevant code snippets. This will help us better understand your implementation and provide a more accurate and effective solution.      

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.  


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.