I am new to ASP.Net and I am confused about the way a GridView control works inside an UpdatePanel. 

I have read the documentation [here](http://msdn.microsoft.com/en-us/library/bb386454%28v=vs.100%29.aspx) which states "By default, any postback control inside an UpdatePanel control causes an asynchronous postback and refreshes the panel's content." yet, when I place a GridView and a Button control inside the element, unless the button has a defined OnClick event to do grid1.DataBind();, the grid will NOT refresh its data. Also, I have tried by specifying an AsyncPostBackTrigger on the UpdatePanel for the Button, but again I got the same behaviour. Now, I noticed that the UpdatePanel DOES refresh when I press a Button without OnClick event, however the GridView inside it does not. Please can you shed some light on this? Must I always have that call to code behind to explicitly refresh it?

My connection string in Web.Config

```
    <connectionStrings>
        <add name="myConnectionString"
             connectionString="Data Source=XXXXX;Initial Catalog=XXXX;Persist Security Info=True;User ID=XXXXX;Password=XXXXX"
             providerName="System.Data.SqlClient" />
    </connectionStrings>

```

My Default.aspx

```
 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EmptyWebApp.Default" %>
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head runat="server"> <title></title> </head>
 <body>
     <form id="form1" runat="server">
         <div>
             <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true" />
             <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                 <ContentTemplate>
                     <asp:GridView ID="grid1" runat="server" DataSourceID="SQLDevelopment" AutoGenerateColumns="False">
                         <Columns>
                             <asp:BoundField DataField="UserID" HeaderText="UserID" SortExpression="UserID" />
                             <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
                         </Columns>
                     </asp:GridView>
                     <asp:SqlDataSource ID="SQLDevelopment" runat="server"
                    ConnectionString="<%$ ConnectionStrings:myConnectionString %>" 
                    SelectCommand="SELECT * FROM [TestTableA]"></asp:SqlDataSource>
                <%=DateTime.Now.ToString()%> <br />
                <asp:Button ID="btnRefresh" runat="server" Text="Refresh without C# event"/>
                <asp:Button ID="btnRefresh1" runat="server" Text="Refresh with C# event" OnClick="btnRefresh1_Click"/>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
 </form></body><html>

```

My Code behind for btnRefresh1

```
    protected void btnRefresh1_Click(object sender, EventArgs e)
    {
        grid1.DataBind();
    }

```

THANK YOU