Tuesday, December 3, 2013

The Controls collection cannot be modified because the control contains code blocks(i.e.<% …%>) (ASP.NET HTML Editor Extender)

After adding an HTML Editor extender to my asp.net page, an error shows when rendering the page to the browser as stated which is the title of this post. I found the solution in asp.net forums which is to wrap aspx markup codes enclosed with <% %> using placeholder control. The code below is in my ASP.NET Master Page:
<head runat="server">  
   <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />  
   <asp:PlaceHolder Runat="server">  
     <script src='<%=Page.ResolveUrl("~/Scripts/jquery-1.4.1.min.js") %>' language="javascript" type="text/javascript"></script>  
   <asp:ContentPlaceHolder ID="HeadContent" runat="server">  
Reference: Handling Ajax Extenders Error


Post a Comment