title: Getting ScriptManager's ServiceReference generated JavaScript in ASP.NET MVC 3
body: <p>When upgrading an ASP.NET 4 (3.5 rendering) WebForms application to MVC 3, how can I get the same JavaScript generated by <code>ScriptManager</code> for a <code>ServiceReference</code> of an ASMX file?</p>
  
  <p>I have an ASMX web service file that is used extensively via the JavaScript <code>ScriptManager</code> generates for it. The existing code needs to continue to work but you can't use <code>ScriptManager</code> in an MVC view. Is there a way to have the JavaScript code automatically generated in ASP.NET MVC?</p>
  
  <p>Here is how I have it in my <code>Default.aspx</code> WebForm page:</p>
  
  <pre><code>&lt;asp:ScriptManager ID="sm" runat="server"&gt;
      &lt;Services&gt;
          &lt;asp:ServiceReference Path="/WebService.asmx" /&gt;
      &lt;/Services&gt;
  &lt;/asp:ScriptManager&gt;
  </code></pre>