1

I'm working with jquery ui in asp.net web forms I have loaded the libraries and everything is working ok but i can only run the scripts by placing the script in the head section of the master page or the default page. I cant seem to link to an external script file and run the script from it.

I have this in the head of my master page:

  <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
  <script src="Scripts/js/jquery-ui-1.8.13.custom.min.js" type="text/javascript"> </script>
  <script src="Scripts/myscript.js" type="text/javascript"></script> <!--this does not load -->
  <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
  <link href="Scripts/css/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css"   />

I have tried various things but it doesn't seem to work

Any ideas what I'm doing wrong ?

4

1 に答える 1

3

マスターページからの相対的な位置が原因​​で、スクリプトが見つかりません。

試す

 <script src='<%= ResolveUrl("~/Scripts/js/jquery-ui-1.8.13.custom.min.js")%>' type="text/javascript"></script>
于 2012-06-10T13:35:16.267 に答える