title: File is not opening
body: <p>I have a grid in which file names are displayed as link buttons. But when I click on link button, file does not open. Please see the cs file code method to open file.</p>
  
  <pre><code>protected void OpenFile(object sender, EventArgs e)
      {
          LinkButton btn = (LinkButton)sender;
          string fileName = btn.Attributes["FileName"].ToString();
  
          string path = Server.MapPath(".") + "\\Files\\" + fileName;
          if (File.Exists(path))
          {
              Response.AppendHeader("content-disposition", "attachment; filename=" + fileName);
              string type = "Application/word";
              if (type != "")
                  Response.ContentType = type;
              Response.WriteFile(path);
              Response.End();
          }
          else
          {
          }
  
          //System.Diagnostics.Process.Start(@path);
          //Response.Write(path);   
      }
  </code></pre>
  
  <p>Here is the code of Gridview:</p>
  
  <pre><code>&lt;asp:GridView ID="gdvMainList" runat="server" CssClass="Grid" 
                                                  AutoGenerateColumns="False" DataSourceID="dtsFilesUploaded" 
                                                  AllowPaging="True" DataKeyNames="Id, FileName" 
                                                  onrowdatabound="gdvMainList_RowDataBound"&gt;
                                                  &lt;Columns&gt;
                                                      &lt;ucc:CommandFieldControl HeaderText="Actions" ShowDeleteButton="true" ButtonType="Image"
                                                          DeleteImageUrl="~/App_Themes/Default/images/delete.png" ShowEditButton="true"
                                                          EditImageUrl="~/App_Themes/Default/images/edit.png" ShowCancelButton="true" CancelImageUrl="~/App_Themes/Default/images/cancel.png"
                                                          UpdateImageUrl="~/App_Themes/Default/images/update.png" DeleteConfirmationText="Are you sure you want to delete?"&gt;
                                                          &lt;ItemStyle HorizontalAlign="Center" Width="60px" /&gt;
                                                          &lt;HeaderStyle HorizontalAlign="Center" /&gt;
                                                      &lt;/ucc:CommandFieldControl&gt;
                                                      &lt;asp:TemplateField HeaderText="File Name"&gt;
                                                          &lt;ItemTemplate&gt;
                                                              &lt;asp:LinkButton ID="lblFileName" runat="server" Text='&lt;%# Bind("FileName") %&gt;' OnClick="OpenFile" CausesValidation="false"&gt;&lt;/asp:LinkButton&gt;
                                                          &lt;/ItemTemplate&gt;
                                                      &lt;/asp:TemplateField&gt;
                                                      &lt;asp:TemplateField HeaderText="Uploaded On"&gt;
                                                          &lt;ItemTemplate&gt;
                                                              &lt;asp:Label ID="lblCreatedDate" runat="server" Text='&lt;%# Bind("CreatedDateTime","{0:d}") %&gt;'&gt;&lt;/asp:Label&gt;
                                                          &lt;/ItemTemplate&gt;
                                                      &lt;/asp:TemplateField&gt;
                                                      &lt;asp:TemplateField HeaderText="Category"&gt;
                                                          &lt;ItemTemplate&gt;
                                                              &lt;asp:Label ID="lblglCategoryId" runat="server" Text='&lt;%# Bind("glCategoryId") %&gt;'&gt;' &gt;&lt;/asp:Label&gt;
                                                          &lt;/ItemTemplate&gt;
                                                          &lt;EditItemTemplate&gt;
                                                              &lt;asp:DropDownList ID="ddlglCategoryId" runat="server" CssClass="textEntry2" DataSourceID="dtsglCategoryId"
                                                                  DataTextField="LookupItem" DataValueField="Id" AppendDataBoundItems="true"&gt;
                                                              &lt;/asp:DropDownList&gt;
                                                          &lt;/EditItemTemplate&gt;
                                                      &lt;/asp:TemplateField&gt;
  
                                                      &lt;asp:BoundField DataField="Description" HeaderText="Description" ReadOnly="true" /&gt;
                                                  &lt;/Columns&gt;
                                                  &lt;EmptyDataTemplate&gt;
                                                      &lt;div class="divEmptyListingGrid"&gt;
                                                          --- No Files Exists ---
                                                      &lt;/div&gt;
                                                  &lt;/EmptyDataTemplate&gt;
                                              &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Any help will be appreciated. Thanks !</p>