The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
we need to access the c# variable in .aspx page at the time
Declare C# code behind variable either public or protected and then us it in <% %> block. e.g. <%= strMyCodebehindvariable%> or <%# strMyCodebehindvariable%>. If you are using second option then you must call DataBind() method in page load.
<% %>
<%= strMyCodebehindvariable%>
<%# strMyCodebehindvariable%>
DataBind()