我在报告中有几个标记部分,如下所示:
<div class="report-section span-24 last">
<h3 class="section-header">
Municipal Valuation</h3>
<p class="section-desc">
<img src='<%= ResolveUrl("~/Images/info-icon.png")%>' class="left" alt="Section Description" />
The <strong>Municipal Valuation</strong> is the valuation provided by the relevant
municipality and represents the market value assessed for rates purposes as at the
date of valuation.</p>
</div>
我想创建一个用户控件来封装每个部分中相同的所有内容,这样我就可以这样定义我的部分:
<lsReport:Section ID="reportDetails" runat="server" Title="Transfer Information">
<Description>The <strong>Municipal Valuation</strong> is the valuation provided by the relevant
municipality and represents the market value assessed for rates purposes as at the
date of valuation.</Description>
</lsReport:Section>
因此标题始终位于<h3 class="section-header">
中,描述段落始终包含图像等。我该怎么做?我已经可以在控件的属性中定义Description文本,但有些描述很长,并且包含标记。我想知道如何使用控件元素的Description子元素设置控件的Description属性。
答案 0 :(得分:2)
我认为您可以使用自定义模板化用户控件来完成您要执行的操作。
<uc:lstReport id="report1" Title="somevalue" runat="server">
<Description>
Some custom content you want rendered in the desc.
</Description>
<ItemTemplate>
Here is a calendar: <asp:calendar id="cal1" runat="server" />
</ItemTemplate>
</uc:lstReport>
将this链接作为首发。