Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
i got the following error when i wanted to find a control in the head tag
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
Posted
Comments
Steven.Pinto2000 18-Jul-11 8:16am    
Thank you for your reply But i want the reason Why does this Happnes
I got the solution

Change your <%= (a response.Write expression) to <%# (a databinding expression), and see if that doesn't help.

If you want more info on the differences between the two, as well as additional variations, google is your friend.
 
Share this answer
 
v3
Comments
Steven.Pinto2000 18-Jul-11 8:16am    
Thank you for your reply But i want the reason Why does this Happnes
I got the solution
If you have script tags like this:
<%= DateTime.Now %>

Replace them with DataBinding expressions instead. Like this:
<%# DateTime.Now %>
 
Share this answer
 
v2
Comments
Steven.Pinto2000 18-Jul-11 8:16am    
Thank you for your reply But i want the reason Why does this Happnes
I got the solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900