title: Assign href of anchor with jQuery in Asp.net
body: <p>I want to assign the href value of an anchor with jQuery. This href will be a function in my code behind file or any other file. This is how I am doing:</p>
  
  <pre><code>$("#btnDownload").attr("href", "/GetFile");
  </code></pre>
  
  <p>But it's not working, it's redirecting to page not found. I have tried this as well:</p>
  
  <pre><code>$("#btnDownload").attr("href", "/MyFile.aspx/GetFile")
  </code></pre>
  
  <p>with [WebMethod] attribute but no luck. How can I assign the href of an anchor with the method of my code? And where should I place this function?</p>