Мастер-страницы jquery ui и asp.net - PullRequest
       21

Мастер-страницы jquery ui и asp.net

0 голосов
/ 09 августа 2011

Может кто-нибудь сказать мне, почему этот код, который работает без главной страницы, отказывается работать, когда я использую вложенные главные страницы.Ссылки на необходимые файлы 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 Ответ

2 голосов
/ 09 августа 2011

Проверьте, как вы ссылаетесь на библиотеки. Они локальные или вы загружаете их из CDN? Я бы использовал Google 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

Если вы используете локальные ссылки, см. этот вопрос , чтобы убедиться в правильности ссылок на библиотеки.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...