jquery ui和asp.net母版页

时间:2011-08-09 01:09:09

标签: jquery asp.net user-interface

有人可以告诉我为什么这个没有母版页的代码在我使用嵌套母版页时拒绝工作。必要的jquery js文件已在基本母版页中引用

<%@ Page Title="" Language="C#" MasterPageFile="~/Detail.master" AutoEventWireup="true"
    CodeBehind="FieldWorkerDetail.aspx.cs" Inherits="FoodVault.Web.WebForms.Admin.FieldWorkerDetail" %>

<%@ Register Assembly="RepeaterPager" Namespace="RepeaterPager" TagPrefix="fv" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>    


<asp:Content ID="Content1" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">     // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
    function Show()
     {

            $("#dialog-message").dialog({
                modal: true,
                buttons: {
                    Ok: function () {
                        $(this).dialog("close");
                    }
                }
            });
            $("#dialog-message").dialog("open");

        }
    </script>
        <div class="demo">
            <input id="Button1" type="button" value="button" onclick="Show()" />
<div id="dialog-message" title="Download complete">
    <p>
        <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
        Your files have downloaded successfully into the My Downloads folder.
    </p>
    <p>
        Currently using <b>36% of your storage space</b>.
    </p>
</div>

<!-- Sample page content to illustrate the layering of the dialog -->
<div class="hiddenInViewSource" style="padding:20px;">
    <p>Sed vel diam id libero <a href="http://example.com">rutrum convallis</a>. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.</p>
    <form>
        <input value="text input" /><br />
        <input type="checkbox" />checkbox<br />
        <input type="submit" onclick="Show()" />radio<br />
        <select>
            <option>select</option>
        </select><br /><br />
        <textarea>textarea</textarea><br />
    </form>
</div><!-- End sample page content -->

</div><!-- End demo -->

1 个答案:

答案 0 :(得分:2)

检查引用库的方式。他们是本地的还是您从CDN加载它们?我会使用谷歌的CDN

<script type="text/javascript"  src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript"  src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script>

以下是您应该使用CDN的原因:http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/

另一篇关于母版页的好文章: http://odetocode.com/Articles/450.aspx

看到您正在使用本地引用,请参阅this question以确保正确引用库。