title: UpdatePanel Gridview not updating
body: <p>For some reason, I can't get the Gridview in the Updatepanel to refresh after I've made changes. can someone help?</p>
  
  <p>I'm using the ToolkitScriptManager control and the UpdatePanel.</p>
  
  <pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt;
     &lt;ContentTemplate&gt;
          &lt;asp:GridView blah...
  
           &lt;/asp:GridView&gt;
  
      &lt;/ContentTemplate&gt;
     &lt;Triggers&gt;
         &lt;asp:AsyncPostBackTrigger ControlID="DeleteButton" EventName="Click" /&gt;
         &lt;asp:AsyncPostBackTrigger ControlID="IBUpUp" EventName="Click" /&gt;
         &lt;asp:AsyncPostBackTrigger ControlID="IBDownDown" EventName="Click" /&gt;
         &lt;asp:AsyncPostBackTrigger ControlID="IBUp" EventName="Click" /&gt;
         &lt;asp:AsyncPostBackTrigger ControlID="IBDown" EventName="Click" /&gt;
         &lt;asp:AsyncPostBackTrigger ControlID="EditProfile" EventName="Click" /&gt;
     &lt;/Triggers&gt;
  </code></pre>
  
  <p></p>
  
  <p>Cs Page</p>
  
  <pre><code>protected void Unnamed3_Click(object sender, ImageClickEventArgs e)
          {
  
              int rowIndex = GridView1.SelectedIndex;
              GridViewRow gvr = GridView1.SelectedRow;
  
              if (rowIndex &gt;= 0)
              {
                  //delete
  
                  String GridViewOne = GridView1.DataKeys[rowIndex].Value.ToString();
  
                  //delete image
  
                  string imagename = gvr.Cells[2].Text;
  
                  string pathToImage = @"C:\Images\";
  
                  pathToImage = pathToImage + imagename;
  
  
                  if (System.IO.File.Exists(pathToImage))
                  {
                      // Use a try block to catch IOExceptions, to
                      // handle the case of the file already being
                      // opened by another process.
                      try
                      {
                          System.IO.File.Delete(pathToImage);
                      }
                      catch (System.IO.IOException m)
                      {
                          Console.WriteLine(m.Message);
                          return;
                      }
                  }
  
                  int bannerid = Convert.ToInt32(GridViewOne); 
  
                  SqlDataReader sdr = null;
  
                  SqlConnection conn = GetConnection();
  
                  SqlCommand cmd = new SqlCommand("Tool_DeleteBannerAds", conn);
  
                  cmd.CommandType = CommandType.StoredProcedure;
  
                  SqlParameter param1 = new SqlParameter();
  
                  param1.ParameterName = "@BannerID";
                  param1.Value = bannerid;
  
                  cmd.Parameters.Add(param1);
  
                  conn.Open();
  
                  sdr = cmd.ExecuteReader();
  
                  sdr.Close();
  
                  UpdatePanel1.Update();
                  GridView1.DataBind();
  
              }
              else
              {
                  //don't do anything
                  //keep
                  //Response.Redirect("Default.aspx");
              }
  
  
          }
  </code></pre>