How to fix ” The Controls collection cannot be modified because the control contains code blocks (i.e. ). “
lets say you have this in your head tag in a master page
<script type=”text/javascript” src='<%=ResolveClientUrl(“~/js/js.js”) %>’></script>
replace the above with
<script type=”text/javascript” src='<%#ResolveClientUrl(“~/js/js.js”) %>’></script>
and then add
VB.NET
Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs)
MyBase.OnLoad(e)
Page.Header.DataBind()
End SubC#
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Page.Header.DataBind();
}
Recent Comments