 <p>You also can set NavigateUrl property in code-behind file, in Page_Load event handler, for instance. It will work.</p> <p>In the code-behind class:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { HyperLink2.NavigateUrl = "~/Default.aspx?customer=&amp;CompanyName=" + Server.UrlEncode("abc#"); } </code></pre> <p>And in markup:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:HyperLink ID="HyperLink2" runat="server" Target="_new"&gt;wc &lt;/asp:HyperLink&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>