title: MVC 2 and the reportviewer with SSRS 2005 - white page, no error
body: <p>I am having an issue with my reportviewer where nothing is visible, not even the control.  If I add other content, it shows, but the reportviewer is not.  I am using the 9.0.0.0 version of the control with SSRS 2005 inside an MVC 2.0 application.  I have built and deployed the report to the server.  I have confirmed by looking on the report server and running it there.</p>
  
  <ol>
  <li>My app is MVC 2.0</li>
  <li>I have added a regular webforms page into the root of the website. I put it in a form, runat=server, and enabled viewstate</li>
  <li>I have added the .aspx routing exception</li>
  <li>My code behind is set up similarly to every example I can find</li>
  <li>My webconfig is configured (maybe that is where my issue is)</li>
  <li>I set up a manual test by forcing the correct values in and I get the same blank page.</li>
  <li>I have a reference to the 9.0.0.0 versions of Microsoft.ReportViewer.WebForms and Microsoft.ReportViewer.Common and as you can see my web.config matches my references.</li>
  </ol>
  
  <p>The page appears white - no control is visible.  No errors are thrown.  As I remembered it, there should at least be a blank Reportviewer control on the page, however there isn't anything there at all.</p>
  
  <p>A few other oddities - If I remove the parameter setting, no error occurrs.  I also added code to send in credentials, but that did not work, even when sending in the credentials for the administrator account.</p>
  
  <p><strong>Report.aspx</strong></p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" ViewStateMode="Enabled" CodeBehind="Report.aspx.cs" Inherits="MySite.Web.Report" %&gt;
  
  &lt;%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
      Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;rsweb:ReportViewer ID="reportViewer" EnableViewState="True" runat="server" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Routing Exceptions</strong></p>
  
  <pre><code>routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
  </code></pre>
  
  <p><strong>Code Behind</strong></p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      var qs = ReportQueryString.Parse(Request.QueryString["R"]);
  
      reportViewer.ServerReport.ReportServerUrl = ConfigurationHelper.Reports.ReportServerUrl;
      reportViewer.ServerReport.ReportPath = String.Format(ConfigurationHelper.Reports.ReportPath, qs.ReportName);
  
      var result = from p in qs.Parameters
                      select new ReportParameter(p.Key, p.Value);
  
      reportViewer.ServerReport.SetParameters(result);
      reportViewer.ServerReport.Refresh();
  }
  </code></pre>
  
  <p><strong>Web.config</strong></p>
  
  <p></p>
  
  <pre><code>&lt;compilation debug="true" targetFramework="4.0"&gt;
    &lt;assemblies&gt;
      &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /&gt;
      &lt;add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /&gt;
    &lt;/assemblies&gt;
      &lt;buildProviders&gt;
          &lt;add type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" extension=".rdl" /&gt;
      &lt;/buildProviders&gt;
  &lt;/compilation&gt;
  
    &lt;pages&gt;
        &lt;namespaces&gt;
            &lt;add namespace="Microsoft.Web.Mvc" /&gt;
            &lt;add namespace="System.Web.Mvc" /&gt;
            &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
            &lt;add namespace="System.Web.Mvc.Html" /&gt;
            &lt;add namespace="System.Web.Routing" /&gt;
            &lt;add namespace="System.Drawing" /&gt;
        &lt;/namespaces&gt;
    &lt;/pages&gt;
  
    &lt;httpHandlers&gt;
        &lt;add type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" path="Reserved.ReportViewerWebControl.axd" verb="*" /&gt;
    &lt;/httpHandlers&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>As requested, here is the page source.  On a side note, I am using Chrome, but I did try IE with the same result.</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;body&gt;
  
  &lt;form method="post" action="Report.aspx?R=rYeJ28xc7emx1PJPgiRkOi1lXjmmNE6pF7aJrEJ443w*" id="form1"&gt;
  
  &lt;div class="aspNetHidden"&gt;
  
  &lt;input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE0NzMwNTUwMTgPZBYCAgEPZBYCAgEPFCsABA8WAh4OUmVuZGVyaW5nU3RhdGULKZUBTWljcm9zb2Z0LlJlcG9ydGluZy5XZWJGb3Jtcy5SZXBvcnRSZW5kZXJpbmdTdGF0ZSwgTWljcm9zb2Z0LlJlcG9ydFZpZXdlci5XZWJGb3JtcywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2ECZCgpWFN5c3RlbS5HdWlkLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkkOTQ5NWQxOTEtMmVmMy00OTJlLTk1ZTgtMzRhZDBkYWI4ZGM4AgEUKwABFCsAAgIBZBYKZg8PFgIeB1Zpc2libGVoZGQCAQ8PFgIfAWhkFgICCA8PFgIfAWhkZAIGDxYCHgVWYWx1ZQUBMGQCBw8WAh8CBQVmYWxzZWQCCA8WAh8CBQVmYWxzZWRkvlE8tEXOwYRIWVLykp+GFwUxbrW+MAtpUdojqbM994U=" /&gt;
  
  &lt;/div&gt;
  
  
  
  
  
  &lt;script src="/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;amp;Version=9.0.30729.4402&amp;amp;Name=Microsoft.Reporting.WebForms.Scripts.ReportViewer.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;div class="aspNetHidden"&gt;
  
  
  
      &lt;input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /&gt;
  
      &lt;input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /&gt;
  
      &lt;input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBgLgrv+UCwL8sqiiBgL8sqyiBgL8srCiBgL8srSiBgL8stiiBkbkdSlUJxfVD65mS2OQpfO01z367cPQhXOdmZguuzmc" /&gt;
  
  &lt;/div&gt;
  
  &lt;div id="reportViewer" style="display:inline-block;height:400px;width:100%;"&gt;
  
      &lt;Script language="javascript"&gt;&lt;!--
  
  
  if (document.getElementById('reportViewer') != null)
  
  {
  
      document.getElementById('reportViewer').ClientController = new RSClientController("reportViewer_ctl03", "ReportFramereportViewer", "/Reserved.ReportViewerWebControl.axd?Mode=true&amp;ReportID=b003c2a678b44c71b949617a693d4f8c&amp;ControlID=9495d1912ef3492e95e834ad0dab8dc8&amp;Culture=1033&amp;UICulture=1033&amp;ReportStack=1&amp;OpType=DocMapArea&amp;Controller=reportViewer&amp;RootLabel=&amp;BackColor=%23ECE9D8&amp;Border=1px+Black+Solid&amp;Font=font-family%3aVerdana%3bfont-size%3a8pt%3b", "25%", false, "/Reserved.ReportViewerWebControl.axd?Mode=true&amp;ReportID=2558c6ccaa09444ea46bd3062bc553dd&amp;ControlID=9495d1912ef3492e95e834ad0dab8dc8&amp;Culture=1033&amp;UICulture=1033&amp;ReportStack=1&amp;OpType=ReportArea&amp;Controller=reportViewer&amp;LinkTarget=_top", true, true, true, true, true, true, "reportViewer_ctl06", false, "\/Reserved.ReportViewerWebControl.axd?Mode=true&amp;ReportID=66fb690f271c48d59bc881cd0f07421d&amp;ControlID=9495d1912ef3492e95e834ad0dab8dc8&amp;Culture=1033&amp;UICulture=1033&amp;ReportStack=1&amp;OpType=Export&amp;FileName=&amp;ContentDisposition=OnlyHtmlInline&amp;Format=", "PrintFramereportViewer", "\/Reserved.ReportViewerWebControl.axd?Mode=true&amp;ReportID=c1c1698c78c7476b8a04e03424d3a36c&amp;ControlID=9495d1912ef3492e95e834ad0dab8dc8&amp;Culture=1033&amp;UICulture=1033&amp;ReportStack=1&amp;OpType=PrintHtml", "reportViewer_ctl07", "reportViewer_ctl00", "reportViewer_ctl08");
  
      document.getElementById('reportViewer').ClientController.PostBackAction =
  
          function(actionType, actionParam)
  
          {
  
              document.getElementById("reportViewer_ctl04").value = actionType;
  
              document.getElementById("reportViewer_ctl05").value = actionParam;
  
              __doPostBack('reportViewer','');
  
          };
  
  }
  --&gt;&lt;/Script&gt;&lt;input type="hidden" name="reportViewer$ctl04" id="reportViewer_ctl04" /&gt;&lt;input type="hidden" name="reportViewer$ctl05" id="reportViewer_ctl05" /&gt;&lt;input type="hidden" name="reportViewer$ctl06" id="reportViewer_ctl06" value="0" /&gt;&lt;input type="hidden" name="reportViewer$ctl07" id="reportViewer_ctl07" value="false" /&gt;&lt;input type="hidden" name="reportViewer$ctl08" id="reportViewer_ctl08" value="false" /&gt;&lt;noscript&gt;
  
          &amp;nbsp;Your browser does not support scripts or has been configured not to allow scripts.
  
      &lt;/noscript&gt;&lt;Script language="javascript"&gt;&lt;!--
  
  
      document.getElementById('reportViewer').ClientController.CustomOnReportLoaded = function() {};
  
      document.getElementById('reportViewer').ClientController.CustomOnAsyncPageChange = function() {};
  
      document.getElementById('reportViewer').ClientController.CustomOnDocMapVisibilityChange = function() {};
  
      document.getElementById('reportViewer').ClientController.CustomOnPromptAreaVisibilityChange = function() {};
  
      document.getElementById('reportViewer').ClientController.CustomOnReloadDocMap = function() {};
  --&gt;&lt;/Script&gt;
  
  &lt;/div&gt;&lt;iframe name="reportViewerTouchSession0" id="reportViewerTouchSession0" onload="if (frames[&amp;#39;reportViewerTouchSession0&amp;#39;].location != &amp;#39;javascript:\&amp;#39;\&amp;#39;&amp;#39;) frames[&amp;#39;reportViewerTouchSession0&amp;#39;].location.replace(&amp;#39;javascript:\&amp;#39;\&amp;#39;&amp;#39;);" src="javascript:&amp;#39;&amp;#39;" style="position:absolute;width:0;height:0;border-width:0;visibility:hidden;"&gt;
  
  
  
  &lt;/iframe&gt;&lt;script type="text/javascript"&gt;
  
      setTimeout("frames['reportViewerTouchSession0'].location.replace('\\\/Reserved.ReportViewerWebControl.axd?Mode=true&amp;ReportID=dd0df78cbe0d4c119d2af4e5a13a33b7&amp;ControlID=9495d1912ef3492e95e834ad0dab8dc8&amp;Culture=1033&amp;UICulture=1033&amp;ReportStack=1&amp;OpType=SessionKeepAlive&amp;TimerMethod=KeepAliveMethodreportViewerTouchSession0&amp;CacheSeed=' + encodeURIComponent(Date()));", 0);function KeepAliveMethodreportViewerTouchSession0() {setTimeout("frames['reportViewerTouchSession0'].location.replace('\\\/Reserved.ReportViewerWebControl.axd?Mode=true&amp;ReportID=dd0df78cbe0d4c119d2af4e5a13a33b7&amp;ControlID=9495d1912ef3492e95e834ad0dab8dc8&amp;Culture=1033&amp;UICulture=1033&amp;ReportStack=1&amp;OpType=SessionKeepAlive&amp;TimerMethod=KeepAliveMethodreportViewerTouchSession0&amp;CacheSeed=' + encodeURIComponent(Date()));", 1140000);}
  
  &lt;/script&gt;&lt;Script language="javascript"&gt;&lt;!--
  document.getElementById('reportViewer').ClientController.ShowInitialWaitFrame();
  
  --&gt;&lt;/Script&gt;
  
  
  
  &lt;script type="text/javascript"&gt;
  
  //&lt;![CDATA[
  
  var theForm = document.forms['form1'];
  
  if (!theForm) {
  
      theForm = document.form1;
  
  }
  
  function __doPostBack(eventTarget, eventArgument) {
  
      if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
  
          theForm.__EVENTTARGET.value = eventTarget;
  
          theForm.__EVENTARGUMENT.value = eventArgument;
  
          theForm.submit();
  
      }
  
  }
  
  //]]&gt;
  
  &lt;/script&gt;
  
  
  
  &lt;/form&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>