The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
来源:互联网 发布:淘宝88元xbox360手柄 编辑:程序博客网 时间:2024/04/24 07:32
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).问题的解决方法。
源码如下:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Welcome.master.cs" Inherits="MasterPage_Welcome" %>
<%@ Register src="../UserControl/Level1_.ascx" tagname="Level1_" tagprefix="uc1" %>
<%@ Register src="../UserControl/Header.ascx" tagname="Header" tagprefix="uc2" %>
<%@ Register src="../UserControl/Footer.ascx" tagname="Footer" tagprefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>明芳管理系统 - <%= Page.Title %></title>
<link href="~/Styles/MainStyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../Scripts/JQuery/jquery-1.8.0.min.js"></script>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<script type="text/javascript">
$(document).ready(function () {
if ($('#<%#lingjian.ClientID%>').val() == "4")
$(".main-header").css("height", "75px");
else if ($('#<%#lingjian.ClientID%>').val() != "3")
$(".main-header-inner").css("line-height", "50px");
});
</script>
</head>
<body>
<ext:ResourceManager ID="ResourceManager2" runat="server" DirectMethodNamespace="CompanyX" />
<form id="form1" runat="server">
<asp:HiddenField runat="server" ID="lingjian" />
<div class="main-header">
<div class="main-header-inner">
<ul class="main-header-menu" runat="server" id="custommenu">
<uc1:Level1_ ID="Level1_1" runat="server" />
<%--<li><a href="PingBan.aspx">平板调库</a></li>--%>
<%--<li><a href="RawProcess.aspx">原材收料</a></li>--%>
<%--<li><a href="ShengChan.aspx">生产管理</a></li>--%>
<%--<li><a href="StockPro.aspx">零件库存</a></li>--%>
<%--<li><a href="RawList.aspx">原材库存</a></li>--%>
<%--<li><a href="ProList.aspx">交货记录</a></li>--%>
<%--<li><a href="StockDetail.aspx">库存信息</a></li>--%>
<%--<li><a href="Profile.aspx">修改资料</a></li>
<li><a href="../Process/StatisticReport.aspx">报表</a></li>--%>
<%
Response.Write(Convert.ToString(Session["Authorities"]));
%>
<uc2:Header ID="Header1" runat="server" />
</ul>
</div>
</div>
<div class="main-body">
<div class="main-body-inner">
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="clear"></div>
</div>
<div class="main-footer">
<div class="main-footer-inner">
<uc3:Footer ID="Footer1" runat="server" />
</div>
</div>
</form>
</body>
</html>
当添加这句代码时出现上述错误:<ext:ResourceManager ID="ResourceManager2" runat="server" DirectMethodNamespace="CompanyX" />
解决方法:
1. 将<%= 换为<%#
2. 在.asp或模板页中的Page_Load事件中添加如下代码
- The Controls collection cannot be modified because the control contains code blocks (i.e. ).
- 错误:The Controls collection cannot be modified because the control contains code blocks (i.e. ).
- 解决 The Controls collection cannot be modified because the control contains code blocks (i.e. )问题
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- 错误:The Controls collection cannot be modified because the control contains code blocks (i.e. ).
- The image cannot be displayed because it contains errors
- The file contains a character that cannot be represented in the current code page (936)
- warning C4819: The file contains a character that cannot be represented in the current code page
- VSE: The file contains a character that cannot be represented in the current code page (936).
- warning C4819: The file contains a character that cannot be represented in the current code page
- warning C4819: The file contains a character that cannot be represented in the current code page
- warning C4819: The file contains a character that cannot be represented in the current code page
- The problem of “Can’t exit design mode because control ‘ShockwaveFlash1’ cannot be created.”
- cannot be opened because the project file cannot be parsed
- cannot be opened because the project file cannot be parsed
- The ActiveX Control cannot be instantiated 解决方法
- VC++ 第三课
- Android百度地图相关内容汇总
- Address already in use: JVM_Bind<null>:8080
- 开发常用到的函数
- 使用UDL测试SQL Server连接问题
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- 制作jffs2根文件系统
- VC中操作excel表格
- 我安装Opencv时的问题和解决方法
- NAT的完全分析及其UDP穿透的完全解决方案
- HDU1213
- Longest Substring Without Repeating Characters
- FreeMarker教程
- CF 18D Seller Bob