title: Does GridView ButtonField click cause a postback?
body: <p>I'm having problems when using a ButtonField to issue a row command.</p>
  
  <p>When I click the ImageButton in the ButtonField, IsPostBack is false</p>
  
  <p><strong>My understanding is that an ImageButton in a ButtonField in a GridView should cause postback to be true.</strong></p>
  
  <p><strong>Question</strong>: Can someone please explain whether I'm right or wrong and if there are properties to set on the button field to get it to issue a postback.</p>
  
  <p><strong>Some code:</strong></p>
  
  <pre><code>Page_Load(object sender, EventArgs e) 
  {
      if (!IsPostBack)
      {
          m_DataTable = GetDataTable();      
          Session["m_DataTable"] = m_DataTable;
      }
      else
      {
          m_DataTable = Session["m_DataTable"];
      }
  }
  </code></pre>
  
  <p>and later in the code:</p>
  
  <pre><code>GridView1.Columns.Clear();
  
  ButtonField cf = new ButtonField();
  cf.HeaderStyle.CssClass = "comGridHeadCell";
  cf.HeaderText = "some text";
  cf.HeaderImageUrl = "images/something.png";
  cf.Text = "action";
  cf.CommandName = "action";
  cf.ImageUrl = "images/something.png";
  cf.ButtonType = ButtonType.Image;
  cf.ItemStyle.CssClass = "comGridLink";
  
  GridView1.Columns.Add(cf);
  
  GridView1.DataSource = m_DataTable;
  GridView1.DataBind();
  </code></pre>
  
  <p>also:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True"  OnRowCommand="GridView_RowCommand" OnPageIndexChanging="GridView_PageIndexChanging"&gt;
    &lt;PagerSettings PageButtonCount="25" /&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Edit:</strong>
  I am running the site in debug mode via VS2010.  I am testing using IE8.
  If I use firefox, <code>IsPostBack == true</code>.  This looks like a specific issue when debugging in IE8.</p>