2014-01-16 88 views
1

我正在嘗試不同的方式來使這項工作,但任何成功。我正在嘗試將mootools與一個asp.net應用程序集成。我只是想用它來爲我的網站添加一些效果。我也使用更新面板,scriptmanager,因爲不想完整的回發。在控制檯上發生錯誤TypeError:clientID.startsWith不是一個函數,當進行更新brwoser重置.... 這是整個代碼。希望能幫助我,並感謝阿甘!衝突Mootools Scriptmanager Ajax Asp.net?

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Default.master.cs" Inherits="guiaEscoles" %> 

<!DOCTYPE html> 
<html> 
<head runat="server"> 
    <title>Title go here</title> 
    <link href="~/css/main.css" rel="stylesheet" type="text/css" /> 
    </head> 
<body> 
    <form runat="server"> 
     <asp:ScriptManager ID="ScriptManager1" runat="server" LoadScriptsBeforeUI="true" EnablePartialRendering="true" > 
      <Scripts> 
       <asp:ScriptReference Path="~/scripts/mootools-core-1.4.5-full-compat-yc.js"></asp:ScriptReference> 
       <asp:ScriptReference Path="~/scripts/mootools-more-1.4.0.1-yc.js" ></asp:ScriptReference> 
       <asp:ScriptReference Path="~/scripts/jsecoles.js"></asp:ScriptReference>     
      </Scripts> 
     </asp:ScriptManager> 

     <asp:Panel runat="server" DefaultButton="" > 
      <asp:UpdatePanel runat="server" UpdateMode="Always"> 
       <ContentTemplate> 
        <asp:DropDownList runat="server" ID="DropDownListCountries" > 
        </asp:DropDownList> 
       </ContentTemplate> 
      </asp:UpdatePanel> 
     </asp:Panel> 

     <asp:ContentPlaceHolder ID="MainContent" runat="server" /> 

    </form> 
</body> 
</html> 


<%@ Page Title="" Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeFile="search.aspx.cs" Inherits="searchschool" %> 

<%@ MasterType VirtualPath="~/Default.master" %>  

<asp:Content ID="ContentSearch" ContentPlaceHolderID="MainContent" runat="Server"> 

       <div id="PlaceItem" runat="server"> 
        <div id="ulLugar" class=""> 
         <ul> 
          <li> 
           <asp:DropDownList runat="server" ID="DropDownListCountryBottom" AutoPostBack="true" OnSelectedIndexChanged="DropDownListCountryBottom_SelectedIndexChanged" EnableViewState="true"> 
           </asp:DropDownList> 
          </li> 
          <li> 
           <asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
            <Triggers> 
             <asp:AsyncPostBackTrigger ControlID="DropDownListCountryBottom" EventName="SelectedIndexChanged" /> 
            </Triggers> 
            <ContentTemplate> 
             <asp:DropDownList runat="server" ID="DropDownListCounty" OnDataBound="DropDownListCounty_DataBound" AutoPostBack="true" OnSelectedIndexChanged="DropDownListCounty_SelectedIndexChanged" EnableViewState="true"> 
             </asp:DropDownList> 
            </ContentTemplate> 
           </asp:UpdatePanel> 
          </li> 
          <li> 
           <asp:DropDownList runat="server" ID="DropDownListDistrict" OnSelectedIndexChanged="DropDownListDistrict_SelectedIndexChanged" AutoPostBack="true" EnableViewState="true"> 
           </asp:DropDownList> 
          </li> 
         </ul> 
        </div> 

       <div id="divStudies" > 
         <asp:CheckBox ID="CheckBoxStudies" runat="server" Text="<%$ Resources:Escoles, CheckBoxPQPILabel %>" OnCheckedChanged="CheckBoxStudies_CheckedChanged" AutoPostBack="true" /> 
       </div> 

       <asp:Repeater ID="RepeaterThemes" runat="server" OnItemDataBound="RepeaterThemes_ItemDataBound"> 
        <HeaderTemplate> 
         <ul> 
        </HeaderTemplate> 
        <FooterTemplate></ul></FooterTemplate> 
        <ItemTemplate> 
         <li class="liTema"> 
          <asp:CheckBox ID="CheckBoxTheme" runat="server" OnCheckedChanged="CheckBoxTheme_CheckedChanged" AutoPostBack="true" EnableViewState="false" /></li> 
        </ItemTemplate> 
       </asp:Repeater> 

       <asp:UpdatePanel runat="server" UpdateMode="Always"> 
        <ContentTemplate> 
         <asp:GridView runat="server" ID="GridViewEscoles" CellPadding="0" CellSpacing="0" BorderStyle="None"> 
          <Columns> 
           <asp:TemplateField> 
            <ItemTemplate> 
             <asp:Label Text='<%# Eval("Field_1") %>' runat="server" /> 
            </ItemTemplate> 
           </asp:TemplateField> 
          </Columns> 
         </asp:GridView> 
        </ContentTemplate> 
       </asp:UpdatePanel> 

</asp:Content> 

這裏是myjs文件:

window.addEvent('domready', function() { 

    alert("Hello"); 
    //var countTotal = $$('.liTema').length; 
    //alert(countTotal); 



}); 
+0

我不認爲這是Mootools特定的。谷歌搜索和發現類似的問題與jQuery也... – Rikard

+0

我能做些什麼? – user2528557

回答

0

這是由於&微軟的Ajax代碼mootools的之間有衝突,據他們指責微軟的代碼中的錯誤mootools的。我正在尋找解決方案,但直到現在還沒有找到