title: ASP.NET Display File from FileUpload Control
body: <p>I have an HTML page (OK, ASP.NET) with a <a href="http://msdn.microsoft.com/en-us/library/aa479405.aspx" rel="nofollow noreferrer">FileUpload</a> control.</p>
  
  <pre><code>&lt;asp:GridView ID="DocGrid" ShowFooter="True" AutoGenerateColumns="False" runat="server" DataKeyNames="doc_id,req_id,doc_name,doc_path" BorderStyle="Solid" BorderWidth="1px" BorderColor="Silver" Width="500px" BackColor="White"&gt;
    &lt;Columns&gt;
      &lt;asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Document"&gt;
        &lt;ItemTemplate&gt;
          &lt;asp:HyperLink ID="HyperLink1" Text='&lt;%# Bind("doc_name") %&gt;' NavigateUrl='&lt;%# Bind("doc_path") %&gt;' Target="_blank" runat="server"&gt;&lt;/asp:HyperLink&gt;
        &lt;/ItemTemplate&gt;
        &lt;FooterTemplate&gt;
          &lt;asp:FileUpload ID="fuFooter" runat="server" Width="350px" /&gt;
        &lt;/FooterTemplate&gt;
      &lt;/asp:TemplateField&gt;
    &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>That isn't all of the HTML, but it should be everything needed to understand the question.</p>
  
  <p>In VB code behind, the uploaded files are correctly saved using this bit of code:</p>
  
  <pre><code>Dim fuFooter As FileUpload = CType(DocGrid.FooterRow.FindControl("fuFooter"), FileUpload)
  If (fuFooter.HasFile) Then
    Dim uploadDir As String = Server.MapPath(VIRTUAL_REC_DOCS)
    If Not String.IsNullOrEmpty(uploadDir) Then
      Dim item As New ReqDoc()
      item.doc_name = fuFooter.FileName
      item.doc_path = uploadDir &amp; fuFooter.FileName
      fuFooter.SaveAs(item.doc_path)
      item.req_id = Request.QueryString("Req_id")
      DocReqManager.insertReqDoc(item)
      bindDocGridgrid()
    End If
  Else
    lblMessage.Text = "No file attached."
  End If
  </code></pre>
  
  <p>The files do, in fact, upload to my <code>VIRTUAL_REC_DOCS</code> folder and saves to the database.</p>
  
  <p>After data binding, the items display in the form's HyperLink control.</p>
  
  <p><img src="https://i.stack.imgur.com/zOKdy.png" alt="screenshot"></p>
  
  <p>For whatever reason, clicking the HyperLink does <strong>NOT</strong> open the item.</p>
  
  <p>Is there a problem with the way the NavigateUrl is displaying the path or is something else going on?</p>