繁体   English   中英

无法使Juice UI正常工作

[英]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库

http://jquery.com/

在调用果汁之前,可能在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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM