2011-08-09 23 views
0

有人可以告诉我为什么这个代码没有母版页拒绝工作,当我使用嵌套母版页。必需的jquery js文件已在基本主页面中引用jQuery的用户界面和asp.net母版页

<%@ 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 --> 
+2

你能否提供更多关于具体错误的详细信息......不要让我们猜测:-) –

+2

另外,请在你的主页上添加一个关于如何引用库的示例 –

+0

是否有点愚蠢()函数在你的母版页中? – rkw

回答

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确保库被正确引用。

+0

他们是本地人。 – Lee

+0

我已经尝试了你的建议,但我仍然没有运气。 – Lee