title: How to include javascript file in the cs code behind in asp.net
body: <p>In default.aspx I have:</p>
  
  <pre><code> &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
      &lt;asp:Button ID="clikme" runat="server" Text="click me" /&gt;    
      &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>In default.aspx I have:</p>
  
  <pre><code>clikme.Attributes.Add("OnClick", "javaScript: return myfunction();");
  </code></pre>
  
  <p>And in JScript1.js I have </p>
  
  <pre><code>function myFunction() {
      alert('this is my function');
      return false;
  }
  </code></pre>
  
  <p>The above code does not work it shows 'Microsoft JScript runtime error: Object expected'. I can't figure out how to find a solution.</p>