title: GridView HyperLink field in C#
body: <p>Take a look at the following code:</p>
  
  <pre><code>&lt;asp:HyperLinkField 
      DataNavigateUrlFields="NameID" 
      DataNavigateUrlFormatString="names.aspx?nameid={0}"
      DataTextField="name" 
      HeaderText="Name" 
      ItemStyle-Width="100px"
      ItemStyle-Wrap="true" /&gt;
  </code></pre>
  
  <p>It takes only the name id to navigate to the next page. How will I include the two other parameters which are not in the gridview. The navigate URL I'm using has to take the keyword which is already present in the gridview and the other two parameters from the database table. I tried using all these codes. Nothing did work for me. </p>
  
  <pre><code>&lt;asp:HyperLinkField DataTextField="Keyword" DataNavigateUrlFields="Keyword"
      DataNavigateUrlFormatString="KeywordSrchSumDtl.aspx?Keyword={0}&amp;State={1}&amp;City={2}"
      HeaderStyle-VerticalAlign="Bottom" ItemStyle-HorizontalAlign="center" /&gt;
  </code></pre>
  
  <p>I cant use the above the code because the state and city are not in the GridView but available in my data table.</p>
  
  <p>I tried using the following code too, but it doesn't work:</p>
  
  <pre><code> &lt;asp:TemplateField HeaderText="Keyword"  ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center"&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:HyperLink ID="link" runat="server" NavigateUrl='&lt;% # "KeywordSrchSumDtl.aspx?Keyword="Eval("Keyword")+"&amp;State="+Request.QueryString["State"]%&gt;' Text='&lt;%# Eval("Keyword") %&gt;'&gt;
          &lt;/asp:HyperLink&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>I also tried this:</p>
  
  <pre><code>        &lt;asp:HyperLink ID="Link1" runat="Server" NavigateUrl='&lt;%#redirectURL()+Server.UrlEncode((Eval("Keyword")).ToString())%&gt;' Text='&lt;%# DataBinder.Eval(Container.DataItem,"Keyword") %&gt;'&gt;
          &lt;/asp:HyperLink&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>.aspx.cs</p>
  
  <pre class="lang-c# prettyprint-override"><code>return "KeywordSrchSumDtl.aspx?Keyword=" + 
      //I DONNO HOW TO CALL THE KEYWORD HERE//
      + "&amp;State=" + System.Web.HttpContext.Current.Request.QueryString["State"]
      + "&amp;City=" + System.Web.HttpContext.Current.Request.QueryString["City"];
  </code></pre>
  
  <p>I don't know how to solve this.</p>