I keep getting the error message ....
The Controls collection cannot be modified because the control contains code
blocks (i.e. <% ... %>).
I am trying to access the innerhtml of a div on my page in some javascript in my head tag. Problem is, the <head> is runat="server" because I also want to set page title dynamically. My javascript in my head tag is...
<script type="text/javascript" language="javascript">
var defaultSBText = "Search for more info...";
function alertDivHTML() {
var elementID = "<%= mainBodyContentPlaceholderDiv.ClientID %>";
//error is thrown.
Can someone elaborate on this error and how to avoid it? It seems like such a common task to do, accessing the CLientID of an elment in order to access it via javascript that i am assuming I am doing somethign blatantly wrong.
Thanks,
Rob