locked
Jquery datepicker Client Side RRS feed

  • Question

  • User-1131752344 posted

    Hello all,

    I have a Jquery datepicker that pulls the controls inside an UpdatePanel and a Gridview. It works just fine on my localhost. However, once I upload on my Web Server the datepicker does not populate. I understand that I need to do it on the client side most likely using ClientID. The problem is that to find the controls I am using a PageRequestManager with a function and it does not allow me to do on the client side. Below is my code. By the way, it works on Chrome but not IE11.

    <script type="text/javascript">
            $(document).ready(function () {
                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(bindPicker);
                bindPicker();
    
            });
    
            function bindPicker() {
                $("input[type=text][id*=GridViewCalendar_txtChangeDate]").datepicker({
                    showWeek: true, firstDay: 1,
                });
                $("input[type=text][id*=GridViewCalendar_txtInsertDate]").datepicker({
                    showWeek: true, firstDay: 1,
                });
                $("input[type=text][id*=GridViewCalendar_txtEmptyDate]").datepicker({
                    showWeek: true, firstDay: 1,
                });
    
            }
    </script>

    Any suggestions on how I can accomplish this?

    Thanks,

    Leo

    Wednesday, December 16, 2015 2:20 PM

Answers

  • User-1131752344 posted

    Hey Guys,

    Sorry, but I actually figured this one out from remember one little, yet very important thing:

    The compatibility mode on my web.config file:

     <system.webServer>
        <httpProtocol>
          <customHeaders>
            <clear />
            <add name="X-UA-Compatible" value="IE=Edge" />
          </customHeaders>
        </httpProtocol>
      </system.webServer>

    I remembered this from a different project that I had. Hope this can help someone in the future.

    Leo

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 16, 2015 7:24 PM