title: ModalPopupExtender + ASP.NET AJAX: Can't page grid
body: <p>I'm trying to page and sort my DataGrid which is inside a ModalPopupExtender but I can't page it in any way, already tried with <code>&lt;Triggers&gt;</code>, put the UpdatePanel inside, outside, in the middle, and it does NOT work. Modal popup does not get closed but the grid just disappears. Code:</p>
  
  <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Page.IsPostBack Then
      BindData()
    End If
  End Sub
  Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
    SqlServerDS.SelectCommand = "SELECT * FROM emp WHERE name LIKE '%" &amp; txtSearchName.Text &amp; "%'"
    BindData()
  End Sub
  Private Sub BindData()
    grdSearch.DataSource = SqlServerDS
    grdSearch.DataBind()
  End Sub
  
  Private Sub grdBuscaPaciente_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdSearch.PageIndexChanging
    grdSearch.PageIndex = e.NewPageIndex
    BindData()
  End Sub
  </code></pre>
  
  <p>Inside the Designer, this is the code h:</p>
  
  <pre><code>&lt;modalpopupextender&gt;
  &lt;/modalpopupextender&gt;
  &lt;panel&gt;
  &lt;updatepanel&gt;
  &lt;gridview&gt;
  &lt;/gridview&gt;
  &lt;/updatepanel&gt;
  &lt;/panel&gt;
  </code></pre>