title: URL # issuie c# querystring asp.net
body: <p>I'm trying to sort out my querystring using the following. There is a hash sign that needs to be displayed in the address for example:</p>
  
  <blockquote>
    <p>Blk 344, Jurong West, Street 11, #02-111</p>
  </blockquote>
  
  <p>Which is stored in the variable <code>address</code>. I am trying to use this code to replace the hash sign: <code>address.Replace("#","%23")</code></p>
  
  <pre><code>string url = "thankyou.aspx?firstname=" + firstname + "&amp;" + 
  "lastname=" + lastname + "&amp;" + "address=" +  address.Replace("#","%23")+ 
   "&amp;" + "total=" + total + "&amp;" + "nric=" + tbID.Text + "&amp;" + "country=" + 
   ddlCountry.SelectedValue + "&amp;" + "orderid=" + orderid + "&amp;"+ 
  "postalcode="+tbPostalCode.Text;
  </code></pre>
  
  <p>But it's still throwing an error. When I replace it in query string it is fine and the data is displayed fine, so this is not the issue.      </p>