[英]using jquery libraries in asp.net user controls
我遇到一個奇怪的問題。 我在用戶控件中使用JQuery日期選擇器。 當我嘗試使用Google托管庫時,一切正常。
即:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js" type="text/javascript"></script>
接下來,我下載了這兩個庫,並將它們添加到我的項目(asp.net網站)中。 當我引用它們並嘗試運行時,它無法識別jquery語法(在jquery代碼處停止並說不識別$)。 但是智能感知正在起作用。
這是我的代碼:
<script src="../_Scripts/jquery-1.8.2.js" type ="text/javascript"></script>
<script src="../_Scripts/jquery-ui.min.js" type ="text/javascript"></script>
<script type ="text/javascript">
$(function () {
$("#<%=TextBox1.ClientID%>").datepicker({ dateFormat: 'dd/mm/yyyy' });
});
</script>
<asp:TextBox runat ="server" ID ="TextBox1" Width ="80px" ></asp:TextBox>
哪里出了問題? 非常感謝您提供一些見識。
<script src="<%=ResolveUrl("~/_Scripts/jquery-1.8.2.js") %>" type="text/javascript"></script>
嘗試這樣做,然后對另一個執行該操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.