Introduction:
Here I will explain how to solve the problem “The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).” when running web application using asp.net.
Description:
I created one web application and added some of script files in header section of page like this
Here I will explain how to solve the problem “The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).” when running web application using asp.net.
Description:
I created one web application and added some of script files in header section of page like this
<head id="head2" runat="server"> <title>Lightbox Page</title> <link href="aspdotnetsuresh.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<%= ResolveUrl("~/js/LightBox.js") %>"></script> </head> |
After add script file to header section i tried to run the application during that time I got error like “The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).”