title: AngularJS without SPA and using ASP.NET MVC routing
body: <p>I want to use AngularJS non-SPA for my website along with ASP.NET MVC. The authentication happens through Active Directory so I find it best to use ASP.NET MVC for routing and authentication/authorization.</p>
  
  <p>So what I would like to do is to create a _Layout.cshtml page that contains a <code>ng-app</code> definition, then each view derived from _Layout.cshtml would contain a <code>ng-controller</code> definition.</p>
  
  <p>For RESTful data handling I would use a ASP.NET Web API.</p>
  
  <p>The only problem I can think of are the URL query string parameters. If I would like to view some record specific by <code>ID</code>, I would always have to put the <code>ID</code> in a <code>ViewBag</code> in the ASP.NET MVC controller and obtain it in the view like this:</p>
  
  <pre><code>&lt;script&gt;
      var roomID = @ViewBag.roomID
  &lt;/script&gt;
  </code></pre>
  
  <p>Is there some better way to do this? Please shed some light. :)</p>