S
suzy
Hello,
I have created a template for my website using the masterpages template
technique.
It's working fine, except when I try to print the value of a querystring
parameter in my HTML code, I get the following error:
"The Controls collection cannot be modified because the control contains
code
blocks (i.e. <% ... %>)."
which is raised from the MasterPage class. It's falling over on the
following line:
if (control.Visible) Controls.Add(control);
Here is the code in my html file.
<MP:MasterPage id="MPContainer" runat="server">
<MP:ContentRegion id="MPHeader" runat="server">My Title</MP:ContentRegion>
<% = Request.QueryString["id"] %>
<MP:ContentRegion id="MPFooter" runat="server">My Footer</MP:ContentRegion>
</MP:MasterPage>
I have created a template for my website using the masterpages template
technique.
It's working fine, except when I try to print the value of a querystring
parameter in my HTML code, I get the following error:
"The Controls collection cannot be modified because the control contains
code
blocks (i.e. <% ... %>)."
which is raised from the MasterPage class. It's falling over on the
following line:
if (control.Visible) Controls.Add(control);
Here is the code in my html file.
<MP:MasterPage id="MPContainer" runat="server">
<MP:ContentRegion id="MPHeader" runat="server">My Title</MP:ContentRegion>
<% = Request.QueryString["id"] %>
<MP:ContentRegion id="MPFooter" runat="server">My Footer</MP:ContentRegion>
</MP:MasterPage>