0
我在一份報告中標記的幾個部分看起來像這樣:如何構建一個使用標籤而不是屬性來設置屬性的UserControl?
<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屬性。
感謝@coder,正確的方向步驟+1,但它看起來像我必須建立一個模板*服務器*控制,而不是用戶控制,以包括數據綁定在這種安排。 – ProfK