0
我有一個CompositeDataBoundControl定義如下:我的CompositeDataBoundControl有什麼問題?
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReportSection.ascx.cs" Inherits="WebReports.ReportSection" %>
<div class="report-section span-24">
<h3>
<%= Title %></h3>
</div>
public partial class ReportSection : CompositeDataBoundControl
{
public string Title { get; set; }
protected override int CreateChildControls(IEnumerable dataSource, bool dataBinding)
{
//throw new NotImplementedException();
return 1; // JUst something to avoid exceptions.
}
}
然而,當我嘗試加載包含此控件的Web窗體,我得到以下分析器錯誤:
「WebReports.ReportSection」這裏不允許使用因爲它沒有擴展類「System.Web.UI.UserControl」。
這對我來說似乎很奇怪,因爲我覺得CompositeDataBoundControl是用作用戶控件的基類,還是它可能只用於服務器控件?