title: call function in <a> tag
body: <p>Hi all i have vb code below which i am tring to call when someone click on the link.</p>
  
  <pre><code>  Private Sub DownloadFile(ByVal fname As String, ByVal forcedownload As Boolean)
      Dim flpth As String
      Dim fnm As String
      Dim ext As String
      Dim tp As String
  
      flpth = System.IO.Path.GetFullPath(Server.MapPath(fname))
      fnm = System.IO.Path.GetFileName(flpth)
      ext = System.IO.Path.GetExtension(fnm)
      tp = ""
  
      If Not IsDBNull(ext) Then
          ext = LCase(ext)
      End If
  
      Select Case ext
          Case ".doc", ".rtf"
              tp = "application/msword"
          Case ".pdf"
              tp = "application/pdf"
          Case ".zip"
              tp = "application/zip"
      End Select
  
      If (forcedownload) Then
          Response.Clear()
          Response.ClearContent()
          Response.ClearHeaders()
          Response.ContentType = tp
          Response.AppendHeader("Content-Disposition", "attachment; filename=" + fnm + ext)
          Response.TransmitFile(flpth)
          Response.Flush()
          Response.End()
      End If
  
  End Sub
  </code></pre>
  
  <p>I am tring to call above code in below line but its not working.  Please can any body help.</p>
  
  <pre><code>&lt;a id="Click" runat="server" href="#"  onclick="DownloadFile('files/Notes.doc',True)"&gt;Click here&lt;/a&gt;
  </code></pre>