文章出處
文章列表
在一個.aspx文件中添加下面的代碼:
<%=EnabledFileType%>
出現錯誤提示:
System.Web.HttpException (0x80004005):
控件包含代碼塊(即 <% ... %>),因此無法修改控件集合。
在 System.Web.UI.ControlCollection.Add(Control child)
對應的英文錯誤為:
The Controls collection cannot be modified because the control contains code blocks
解決方法:
改為如下的代碼(等號改為井號):
<%#EnabledFileType%>
并在Page_Load中添加如下的代碼:
private void Page_Load(object sender, System.EventArgs e)
{
this.DataBind();
}
搞定!
文章列表
全站熱搜