title: Calling Controller from aspx page
body: <p>I have been trying to find a solution to my problem for 2 days now and I am really stuck. Here's the problem:</p>
  
  <p>I have an MVC application (with Dependency injection and the works) with just one webform. This page needs to be a webform because it has a ReportViewer in it and please correct me if I am wrong but an MVC View is incompatible with server controls like ReportViewer. This is the navigation flow of the pages:</p>
  
  <ol>
  <li>Home page navigates to the ReportList page</li>
  <li>ReportList page displays the reports that a user is able to view and navigates to the Report page and passes it the ID of the report that the user selected.</li>
  <li>Report page should look up the ReportPath and the ServerUrl from the database based on the ID passed from the ReportList page at the same time authorizing the user, whose permissions are stored in the database.</li>
  </ol>
  
  <p>I could potentially pass the ReportPath and the ServerUrl as part of the query string so that the report page (aspx, not driven by a controller) does not have to go to the database to get these values. The problem however is how to check that the user is authorized to view the report (someone could just use a link to look at the report).</p>
  
  <p>I did try to hook it into the MVC model and inherited the page from the ViewPage class. The problem there is that the page kept reloading itself for some reason. I still want my page to do as little as possible and a controller to handle calls to the authorization attribute and to the business layer. So, as a last resort, I want to call the controller from the aspx page but I can't create an object of it becasue dependency injection.</p>
  
  <p>Can someone please provide some guidance on this? I have all the code available but don't know what to post.</p>