title: Include javascript file in sharepoint visual web part
body: <p>I am using sharepoint 2010 and developing a visual web part. I had javascript functions on the ascx file and they all used to work file.Now I have moved them to a single javascript.js file and deployed it to the _layouts folder on server. </p>
  
  <p>And I have put the below line on the ascx file to reference to that file</p>
  
  <pre><code>&lt;script src="/sites/xxxxx/_layouts/customwebparts/javascript.js" type="text/javascript"&gt; &lt;/script&gt;
  </code></pre>
  
  <p>and then on the ascx.cs file and I am using the methods defined in this file for eg.,</p>
  
  <pre><code>      btnCancel.Attributes.Add("onclick", "{return Action(Cancel the form?)};");
  </code></pre>
  
  <p>But it is not working, it is not displaying the confimration box ...Am I referencing the wrong way. Please help me ....</p>