Tuesday, November 4, 2008

The Controls collection cannot be modified because the control contains code blocks . AJAX Calendar Extender

If you are using AJAX Calendar Extendar on the page and get this error message.

Do the following to fix the issue.

1. Master Page add a <asp:placeholder> control between <head> tags and move <script>

or

<script type="text/javascript" src="<%=ResolveClientUrl(">/jquery.min.js"></script>


tags within the <asp:placeholder>

So it should look like this


<asp:contentplaceholder id="myPlaceholder" runat="server">

<script type="text/javascript" src="<%=ResolveClientUrl("/javascript/")%>/jquery.min.js"></script>

</asp:ContentPlaceHolder>

2. Add another placeholder control within the <head> tags and name it head.

<asp:contentplaceholder id="head" runat="server"></asp:ContentPlaceHolder>


It should look like this:


<head runat="server">
<asp:contentplaceholder id="myPlaceholder" runat="server">

<script type="text/javascript" src="<%=ResolveClientUrl("/javascript/")%>/jquery.min.js"></script>

</asp:ContentPlaceHolder>

<asp:contentplaceholder id="head" runat="server"></asp:ContentPlaceHolder>


</head>

No comments: