All I want to do is to write something like
<%=Html.ScriptInclude('~/Scripts/jquery.1.2.6.js')%>
When I do that I get an error:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>)
I’m using ASP.NET MVC Release Candidate 1.
Is that impossible to accomplish?
Put your code inside a
<asp:PlaceHolder runat='server'>tag. There was a known bug in RC1 that caused this problem. Check page 23 of the release notes .I haven’t upgraded to 1.0, so I don’t know if this was fixed or not.