Using ASP.NET 2.0, I have a web app where I am trying to use Javascript to make one tab in a tabcontainer the active tab.
The recommendations have been based on:
var mX=document.getElementById('<%= tc1.ClientID%>')
$find('<%= tc1.ClientID%>').set_activeTabIndex(1);
Which both produce the error:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
I've tried moving the code out of the head tag and into the body tag; same error.
I've also tried the alternative <%# tc1.ClientID%>, as in:
var mX = document.getElementById('<%# tc1.ClientID %>')
mX.ActiveTabIndex="2";
Generates a null error - code above is rendered in the html as:
var mX = document.getElementById('')
mX.ActiveTabIndex="2";
Can anyone explain in plain(er) language what this means and what the solution is?
Many thanks Mike Thomas