4

I have a jquery datepicker that works 100% in my dev environment.
When I deploy site onto IIS, the datepicker does show up when the control gets the focus, but clicking on a date does not update the textbox.

Is this a specific permission that needs to be set on IIS?

<script type="text/javascript">
    $(function () {
        $("#<%= txtDateFrom.ClientID  %>").datepicker({ dateFormat: 'yy/mm/dd' });
    });
    $(function () {
        $("#<%= txtDateTo.ClientID  %>").datepicker({ dateFormat: 'yy/mm/dd' }).val();
    });
</script>
4

3 回答 3

1

The problem was not with IIS but with Internet Explorer.
Scripting has not be enabled for the 'Internet Zone'.
See this site for howto.

于 2013-09-25T10:57:23.553 回答
1

javascript does not run on server side (unless you are not using server side javascript solution like Node.js), this issue is not at all related to IIS server because jQuery run in browser.

  • Check jQuery library is included properly.
  • if not, you can directly include jquery from Google check here
  • Use firebug and check there is no javascript error in console
  • Check <%= txtDateFrom.ClientID %> outputs required id.

Try this code

$(function() {
   $("#<%= txtDateFrom.ClientID  %>").datepicker( "option", "dateFormat", "yy-mm-dd");
});
于 2013-09-27T10:52:33.700 回答
1

I am assuming that the script where you have that is in ASP. The <%= %> will only be interpreted in the server end. And when it gets to the user's browser, it should be the interpreted value. Check your HTML output from your browser if it does so.

于 2013-10-02T00:11:51.193 回答