Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 03, 2012 08:06 AM by wetlip
Member
385 Points
257 Posts
Dec 27, 2011 04:06 PM|LINK
even if i add controls in the code in the code blok which is from code behand file it is not accepted. is there way to go around this problem ie still be able to add controls dynamically ?
Contributor
3561 Points
619 Posts
Dec 27, 2011 04:11 PM|LINK
This usually means you have <%%> blocks in the header of a page or your master page. Put them in a placeholder:
<asp:PlaceHolder runat="server"> <script src="<%=Page.ResolveURL("~/Scripts/jquery-1.6.2.min.js")%>" type="text/javascript"></script> <script src="<%=Page.ResolveURL("~/Scripts/jquery-ui-1.8.14.min.js")%>" type="text/javascript"></script> <script src="<%=Page.ResolveURL("~/Scripts/jquery.validate.min.js")%>" type="text/javascript"></script> </asp:PlaceHolder>
Jan 03, 2012 08:06 AM|LINK
sorry havent thought of that, thank you.
wetlip
Member
385 Points
257 Posts
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... ...
Dec 27, 2011 04:06 PM|LINK
even if i add controls in the code in the code blok which is from code behand file it is not accepted. is there way to go around this problem ie still be able to add controls dynamically ?
ryanbesko
Contributor
3561 Points
619 Posts
Re: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ...
Dec 27, 2011 04:11 PM|LINK
This usually means you have <%%> blocks in the header of a page or your master page. Put them in a placeholder:
<asp:PlaceHolder runat="server"> <script src="<%=Page.ResolveURL("~/Scripts/jquery-1.6.2.min.js")%>" type="text/javascript"></script> <script src="<%=Page.ResolveURL("~/Scripts/jquery-ui-1.8.14.min.js")%>" type="text/javascript"></script> <script src="<%=Page.ResolveURL("~/Scripts/jquery.validate.min.js")%>" type="text/javascript"></script> </asp:PlaceHolder>wetlip
Member
385 Points
257 Posts
Re: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ...
Jan 03, 2012 08:06 AM|LINK
sorry havent thought of that, thank you.