2010-04-16 37 views
0

我在以前工作正常的頁面上收到此錯誤,事實上,我最近對頁面進行的唯一更改是添加另一個asp:TextBox和asp:RequiredFieldValidator控件。錯誤信息「控件集合無法修改,因爲控件包含代碼塊」

頁面已經有上衆多的ASP.NET控件,所以我不明白爲什麼這些額外的控制將有所作爲,反正我須張貼下面的代碼,希望你能看到什麼錯誤是:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MeetingGenerator.ascx.cs" 
Inherits="usercontrols_MeetingGenerator" %> 

<%@ Register TagPrefix="cc1" Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" %> 

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
<div style="width:498px;height:425px;background-color:#033b2a;text-align:center;padding-top:20px;">  

    <asp:Label ID="lblDone" CssClass="done" runat="server"></asp:Label> 

    <asp:Panel id="pnlAddReport" runat="server"> 
    <div> 
     <img src="../images/banners/add-meeting.png" alt="Add Report" /> 
    </div> 
    <p> 

    <asp:ValidationSummary ID="ValidationSummary" CssClass="validationsummary" runat="server" /> 
     <asp:TextBox ID="txtTitle" BorderStyle="None" CssClass="watermark" 
      Width="250px" Height="22px" runat="server"></asp:TextBox> 
     <cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" TargetControlID="txtTitle" WatermarkCssClass="watermark" 
      WatermarkText=" Meeting title" runat="server"></cc1:TextBoxWatermarkExtender> 
     <asp:RequiredFieldValidator ID="rfvTitle" ControlToValidate="txtTitle" Text="" 
      ErrorMessage="Please enter the title" Display="None" 
      InitialValue="" runat="server"></asp:RequiredFieldValidator> 
     <asp:RequiredFieldValidator ID="rfvTitle1" ControlToValidate="txtTitle" Text="" 
      ErrorMessage="Please enter the title" Display="None" 
      InitialValue=" Meeting title" runat="server"></asp:RequiredFieldValidator> 
    </p> 

    <p> 
     <asp:TextBox ID="txtDate" BorderStyle="None" CssClass="watermark" 
      Width="250px" Height="22px" runat="server"></asp:TextBox> 
     <cc1:CalendarExtender ID="ceDate" TargetControlID="txtDate" Format="dd/MM/yyyy" runat="server"> 
      </cc1:CalendarExtender> 
     <cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" TargetControlID="txtDate" WatermarkCssClass="watermark" 
      WatermarkText=" Meeting Date" runat="server"></cc1:TextBoxWatermarkExtender> 
     <asp:RequiredFieldValidator ID="rfvDate" ControlToValidate="txtDate" Text="" 
      ErrorMessage="Please select the meeting date" Display="None" 
      InitialValue="" runat="server"></asp:RequiredFieldValidator> 
     <asp:RequiredFieldValidator ID="rfvDate1" ControlToValidate="txtDate" Text="" 
      ErrorMessage="Please select the meeting date" Display="None" 
      InitialValue=" Meeting Date" runat="server"></asp:RequiredFieldValidator> 
    </p> 

    <p> 
     <asp:TextBox ID="txtMeetingTime" BorderStyle="None" Width="250px" Height="22px" MaxLength="5" 
      runat="server"></asp:TextBox> 
     <cc1:TextBoxWatermarkExtender ID="tweMeetingTime" TargetControlID="txtMeetingTime" WatermarkCssClass="watermark" 
      WatermarkText=" Time (HH:MM)" runat="server"></cc1:TextBoxWatermarkExtender> 
     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtMeetingTime" Text="" 
      ErrorMessage="Please enter the meeting time" Display="None" 
      InitialValue="" runat="server"></asp:RequiredFieldValidator> 
    <asp:RequiredFieldValidator ID="RequiredFieldValidator11" ControlToValidate="txtMeetingTime" Text="" 
      ErrorMessage="Please enter the meeting time" Display="None" 
      InitialValue=" Time (HH:MM)" runat="server"></asp:RequiredFieldValidator>  
    </p> 

    <p> 
     <asp:TextBox ID="txtLocation" BorderStyle="None" CssClass="watermark" 
      Width="250px" Height="22px" runat="server"></asp:TextBox> 
     <cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender3" TargetControlID="txtLocation" WatermarkCssClass="watermark" 
      WatermarkText=" Location" runat="server"></cc1:TextBoxWatermarkExtender> 
     <asp:RequiredFieldValidator ID="rfvLocation" ControlToValidate="txtLocation" Text="" 
      ErrorMessage="Please enter the location" Display="None" 
      InitialValue="" runat="server"></asp:RequiredFieldValidator> 
     <asp:RequiredFieldValidator ID="rfvLocation1" ControlToValidate="txtLocation" Text="" 
      ErrorMessage="Please enter the location" Display="None" 
      InitialValue=" Location" runat="server"></asp:RequiredFieldValidator> 
    </p> 

    <p> 
    <asp:ImageButton ID="btnAddMeeting" ImageUrl="/images/buttons/addmeeting-btn.gif" runat="server" OnClick="btnAddMeeting_Click" /> 

    </p> 

    <p> 

    </p> 
    </asp:Panel> 
</div> 

<%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %> 

<asp:content ContentPlaceHolderId="additionalhead" runat="server"> 

</asp:content> 

<asp:content ContentPlaceHolderId="additionalbody" runat="server"> 
    <umbraco:Macro Alias="AddMeeting" runat="server"></umbraco:Macro> 
</asp:content> 

<asp:content ContentPlaceHolderId="bodyContent" runat="server"> 

</asp:content> 

<%@ Master Language="C#" AutoEventWireup="true" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title><umbraco:Item field="title" runat="server"></umbraco:Item></title> 

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> 
    <script type="text/javascript" src="/js/jQueryString-2.0.2-Min.js"></script> 

    <link rel="stylesheet" type="text/css" href="/css/Styles.css" /> 
    <link rel="stylesheet" type="text/css" href="/css/Layout.css" /> 
    <link rel="stylesheet" type="text/css" href="/css/Forms.css" /> 


    <script type="text/javascript" language="javascript"> 
     $(document).ready(function() { 
      $('#uploadAgenda').hide(); 
      $('#uploadMinutes').hide(); 
      $('#<%=txtSearchEAA.ClientID%>').val('Search EAA'); 

      var st = $.getQueryString({ ID:"search" }); 
      if (st != '') { 
       $('#<%=txtSearchEAA.ClientID%>').val(st); 
      }; 

      $('#<%=txtSearchEAA.ClientID%>').click(function() { 
       $('#<%=txtSearchEAA.ClientID%>').val(''); 
      }); 
     }); 
    </script> 

    <script type="text/C#" runat="server"> 
     protected void btnSearch_Click(object sender, EventArgs e) 
     { 
      Response.Redirect("/members/search-results?search=" + txtSearchEAA.Text); 
     } 
    </script> 


    <asp:ContentPlaceHolder id="additionalhead" runat="server"></asp:ContentPlaceHolder> 
    <umbraco:Item field="AdditionalHead" runat="server"></umbraco:Item> 
</head> 
<body style="background-color:#e5e5e5;"> 

<script runat="server"> 
protected void btnLogout_Click(object sender, EventArgs e) 
{ 
    FormsAuthentication.SignOut(); 
    Response.Redirect("/login"); 
} 
</script> 

    <form id="form1" runat="server"> 
    <asp:ContentPlaceHolder id="additionalbody" runat="server"></asp:ContentPlaceHolder> 
     <div class="wrapper"> 
      <div class="content"> 
       <div class="banner"> 
        <div class="bannerSearchSpacer"> 
         <a href="/home"><h1><span>EAA</span></h1></a> 
        </div> 

      <div class="aboutEAA"> 
       &nbsp; 
      </div> 

      <div class="bannerSearchAligns"> 
         <div class="searchbox"> 
           <asp:TextBox ID="txtSearchEAA" CssClass="watermark" 
         Width="155px" runat="server"></asp:TextBox> 
         </div> 
         <div class="searchButton"> 
           <asp:ImageButton ID="imbSearch" ImageUrl="/images/buttons/go.gif" OnClick="btnSearch_Click" runat="server" /> 
         </div> 
        <div style="clear:both;"></div> 
        </div> 

      <div class="loginBox"> 
         <dl> 
        <dt>Hello</dt> 
        <dd><umbraco:Macro Alias="MemberName" runat="server"></umbraco:Macro></dd> 
        <dt>Arena</dt> 
        <dd><umbraco:Macro Alias="MemberArena" runat="server"></umbraco:Macro></dd> 
       </dl> 
       <div><asp:ImageButton ID="btnLogout" ImageUrl="/images/buttons/logout.gif" runat="server" OnClick="btnLogout_Click" /></div> 
        </div> 
      <div style="clear:both;"></div> 
     </div> 



     <div id="contentarea"> 
      <div class="menuLeft">     
       <div class="menuPlaceholder"> 
        <umbraco:Macro Alias="DynamicMenu" runat="server"></umbraco:Macro> 
       </div> 
      </div> 
       <div class="mainBody"> 
        <asp:ContentPlaceHolder id="bodyContent" runat="server"></asp:ContentPlaceHolder> 
       </div> 

       <div style="clear:both;"></div> 
      </div> 
     </div> 
    </div> 

    </form> 



<umbraco:Macro Alias="MemberAnalytics" runat="server"></umbraco:Macro> 



</body> 
</html> 

回答

0

它通過從jQuery選擇器中刪除代碼塊並將其更改爲名稱* =選擇器來進行排序。將<%=更改爲<%#並未解決問題,希望選擇者更改對其他人有用。

0

試着改變你的JQ內<%=到<%# uery腳本。檢出this article

+0

我應該說,我已經看過那篇文章(和其他人喜歡它),並且據我所知,我沒有在任何JavaScript引用中使用ResolveUrl。 – DarrylGodden 2010-04-16 09:49:24

相關問題