title: ReportViewer DatePicker and HttpHandler Issue in Chrome
body: <p>I have a problem with ReportViewer in my project. In Chrome, datepickers were not show up for SSRS datetime parameters. I've found <a href="http://www.rajbandi.net/fixing-ssrs-report-viewer-control-date-picker-in-google-chrome" rel="nofollow">that</a> solution, it worked but this time when I click on "Next Page" or "Last Page" icon of report viewer, results are disapearing. I checked the console and I found that error in response:</p>
  
  <blockquote>
    <p>The Report Viewer Web Control HTTP Handler has not been registered in the application&#39;s web.config file.  Add &lt;add verb=&quot;<em>&quot; path=&quot;Reserved.ReportViewerWebControl.axd&quot; type = &quot;Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt; to the system.web/httpHandlers section of the web.config file, or add &lt;add name=&quot;ReportViewerWebControlHandler&quot; preCondition=&quot;integratedMode&quot; verb=&quot;</em>&quot; path=&quot;Reserved.ReportViewerWebControl.axd&quot; type=&quot;Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt; to the system.webServer/handlers section for Internet Information Services 7 or later.</p>
  </blockquote>
  
  <p><br>
  <strong>My HTML Code:</strong></p>
  
  <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
     &lt;Scripts&gt;
        &lt;asp:ScriptReference Path="~/Kitap/js/ReportViewer.js" /&gt;
        &lt;asp:ScriptReference Path="~/Kitap/js/datepicker-tr.js" /&gt;
     &lt;/Scripts&gt;
  &lt;/asp:ScriptManager&gt;
  &lt;rsweb:ReportViewer ID="MyReportViewer" runat="server"&gt;&lt;/rsweb:ReportViewer&gt;
  &lt;asp:HiddenField ID="DatePickers" runat="server" /&gt;
  </code></pre>
  
  <p><br>
  <strong>ReportViewer.js File:</strong></p>
  
  <pre><code>$(document).ready(function () {
  var isChrome = /Chrome/.test(navigator.userAgent) &amp;&amp; /Google Inc/.test(navigator.vendor);
  fixParameters();
  Sys.WebForms.PageRequestManager.getInstance().add_endRequest(applicationInitHandler);
  
  function applicationInitHandler() {
      fixParameters();
  }
  
  function fixParameters() {
      var exists = false;
      var items = $('.ui-datepicker-trigger');
      if (items != null &amp;&amp; items.length &gt; 0) {
          exists = true;
      }
  
      if (isChrome &amp;&amp; !exists) {
  
          // add date picker
          $($(":hidden[id*='DatePickers']").val().split(",")).each(function (i, item) {
              var h = $("table[id*='ParametersGrid'] span").filter(function (i) {
                  var v = "[" + $(this).text() + "]";
                  return (v != null &amp;&amp; item != "" &amp;&amp; v.indexOf(item) &gt;= 0);
              }).parent("td").next("td").find("input").datepicker({
                  showOn: "button"
                 , buttonImage: '/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Name=Microsoft.Reporting.WebForms.calendar.gif'
                 , buttonImageOnly: true
                 //, dateFormat: 'mm.dd.yy'
                 , changeMonth: true
                 , changeYear: true
              });
          });
  
          // remove time from date
          $($(":hidden[id*='DatePickers']").val().split(",")).each(function (i, item) {
              var h = $("table[id*='ParametersGrid'] span").filter(function (i) {
                  var v = "[" + $(this).text() + "]";
                  return (v != null &amp;&amp; item != "" &amp;&amp; v.indexOf(item) &gt;= 0);
              }).parent("td").next("td").find("input").parent().children("input").each(function () {
                  $(this).val($(this).val().substring($(this).val().length - 12, 0));
              });
          });
      }
  }});
  </code></pre>
  
  <p><br>
  <strong>Code Behind:</strong></p>
  
  <pre><code>protected void Page_Init(object sender, EventArgs e)
  {
      string personParam = ""; //Person Type, I'm setting this in a switch-case but didn't write here.
      MyReportViewer.AsyncRendering = false;
      MyReportViewer.Width = new Unit(100, UnitType.Percentage);
      MyReportViewer.Height = 600;
      MyReportViewer.ShowExportControls = true;
      MyReportViewer.ShowPrintButton = true;
  
      MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
      MyReportViewer.ServerReport.ReportServerUrl = new Uri(@"http://1.1.1.1/ReportServer");
  
      MyReportViewer.ServerReport.ReportServerCredentials = new MyReportServerCredentials();
      MyReportViewer.ShowPrintButton = true;
  
      ReportParameter prmPerson = new ReportParameter(personParam, activePerson.Id.ToString());
      MyReportViewer.ServerReport.SetParameters(prmPerson );
  
      MyReportViewer.ServerReport.ReportPath = "/YAYINCILIK/Ekitap/Rapor";
  
  }
  
  protected void Page_Load(object sender, EventArgs e)
  {
      // Create a Web service proxy object and set credentials
      ReportingService2010 rs = new ReportingService2010();
      rs.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
  
  }
  
  [Serializable]
  public sealed class MyReportServerCredentials :
      IReportServerCredentials
  {
      public System.Security.Principal.WindowsIdentity ImpersonationUser
      {
          get
          {
              // Use the default Windows user.  Credentials will be
              // provided by the NetworkCredentials property.
              return null;
          }
      }
  
      public System.Net.ICredentials NetworkCredentials
      {
          get
          {
              // User name
              string userName = "username";
  
              // Password
              string password = "password";
  
              // Domain
              string domain = "domain";
  
              return new System.Net.NetworkCredential(userName, password, domain);
          }
      }
  
      public bool GetFormsCredentials(out System.Net.Cookie authCookie,
                  out string userName, out string password,
                  out string authority)
      {
          authCookie = null;
          userName = null;
          password = null;
          authority = null;
  
          // Not using form credentials
          return false;
      }
  }
  protected override void OnPreRender(EventArgs e)
  {
      base.OnPreRender(e);
  
      DatePickers.Value = GetDateParameters();
  }
  private string GetDateParameters()
  {
      StringBuilder sb = new StringBuilder();
      int i = 0;
  
      foreach (ReportParameterInfo info in MyReportViewer.ServerReport.GetParameters())
      {
          if (info.DataType == ParameterDataType.DateTime)
          {
              if (i &gt; 0)
              {
                  sb.Append(string.Format(",[{0}]", info.Prompt));
              }
              else
              {
                  sb.Append(string.Format("[{0}]", info.Prompt));
                  i++;
              }
          }
      }
  
      return sb.ToString();
  }
  </code></pre>
  
  <p><br>
  Thanks for help.</p>