title: Binding hyperlink in gridview using c#
body: <p>How to <em>Bind</em> hyperlink in <code>GridView</code> using <code>C#</code>? </p>
  
  <p><code>ASP.NET</code> code:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" onselectedindexchanged="GridView1_SelectedIndexChanged" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField HeaderText="Name"&gt;
              &lt;ItemTemplate&gt;
                 &lt;asp:HyperLink id="HyperLink2" NavigateUrl="" Text="&lt;%#Eval("pdfname") %&gt;" runat="server"/&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>