[英]Can't get Juice UI to work
我是Web開發的新手。 想嘗試使用ASP.NET + JuiceUI。 從Visual Studio中的基本網站項目模板開始,我想嘗試在網頁中獲取JuiceUI Datepicker控件。 我按照說明進行操作,並使用nuget將JuiceUI安裝到我的項目中。 但是,當我嘗試將果汁Datepicker放入我的頁面時,它根本不起作用:
Default.aspx
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1><%: Title %>.</h1>
<h2>Modify this template to jump-start your ASP.NET application.</h2>
</hgroup>
<p>
<asp:TextBox id="_test" runat="server" ></asp:TextBox>
<juice:Datepicker TargetControlID="_test" runat="server" />
</div>
</section>
</asp:Content>
而且它不起作用...我在頁面中看到一個啞巴的文本框,僅此而已。 由於這是非常簡單的代碼,我想我一定在某個地方犯了一些愚蠢的錯誤。 如果有人可以幫助我,我將非常感激,因為我是Web開發人員的新手。
編輯
JavaScript錯誤:
ReferenceError: jQuery is not defined [http://localhost:2964/Scripts/amplify.js:788]
ReferenceError: jQuery is not defined [http://localhost:2964/Scripts/juice.js:201]
解:
使用Juice的nuget安裝創建的ScriptManager
:
<asp:ScriptManager runat="server">
<Scripts>
<asp:ScriptReference Name="jquery"/>
<asp:ScriptReference Name="jquery.ui.combined"/>
</Scripts>
</asp:ScriptManager>
固定:
<asp:ScriptManager runat="server">
<Scripts>
<asp:ScriptReference Name="jquery" Path="~/Scripts/jquery-1.8.3.js"/>
<asp:ScriptReference Name="jquery.ui.combined" Path="~/Scripts/jquery-ui-1.9.2.js"/>
</Scripts>
</asp:ScriptManager>
而且有效。
從錯誤中很明顯,您需要包含jQuery庫
在調用果汁之前,可能在aspx頁面頂部。
例如:
<script type="text/javascript" src="jquery.js"></script>
更多:
您從哪里包括jQuery庫? Google JSAPI? CDN?
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.