title: DataList Command cannot redirect to another page
body: <p>I'm facing a problem that I can't redirect to another page by using DataList Command. Here is my code for aspx.</p>
  
  <pre><code>&lt;asp:DataList id="CategoryList"
         OnItemCommand="Barcode_RowCommand"
         BorderColor="black"
         CellPadding="1"
         CellSpacing="1"
         RepeatDirection="Horizontal"
         RepeatLayout="Table"
         RepeatColumns="4"
         BorderWidth="0"
         runat="server" ItemStyle-HorizontalAlign="Center" ItemStyle-Font-Names="arial" ItemStyle-Font-Size="12px"                   
         ItemStyle-ForeColor="#ffffff" style="margin-left:auto; margin-right:auto;"&gt;
  </code></pre>
  
  <p>How i handle the command with a image button</p>
  
  <pre><code>&lt;asp:ImageButton ID="Add" 
            ImageUrl= '&lt;%# "getImage.aspx?Barcode=" + Eval("Barcode")  %&gt;'
            ForeColor="black" 
            runat="server"
            Visible="true"
            Width = "200px"
            height ="170px"
            CommandArgument='&lt;%# Eval("Barcode")%&gt;'
            DataKeyField="Barcode"
            CommandName="Add"&gt;&lt;/asp:ImageButton&gt;
  </code></pre>
  
  <p>below is my code for aspx.cs</p>
  
  <pre><code>public void Barcode_RowCommand(Object sender, DataListCommandEventArgs e)
      {
          if (e.CommandName == "Add")
          {
              Response.Redirect("ProductDetail.aspx");
          }
      }
  </code></pre>
  
  <p>the code has no error but when i click on the image button, it doesn't redirect me to the productdtail.aspx but just at the same page. any help or suggestion will be appreciate. thanks again</p>