0

我有一个非常大的财务表,它将在一个页面上重复 4 次,跨越网站上的许多不同页面。

我不喜欢在一个页面上复制表格 4 次的想法。所以我想调用它一次,可能使用控件。然后填充表格四次,加载在 .cs 后端中定义的设置值。?

a) 可以这样做吗?

b) 我已经阅读了关于中继器、数据表、网格的文章,请问有人能告诉我我需要采取的直接方式吗?

<div id="finance-boxes" class="span3">
    <table class="table">
        <tr><th>36 month PCP</th></tr>
        <tr><td colspan="2"><img src="/images/1" alt="Mitsubishi Mirage PCP" /></td></tr>

        <tr><td class="title">On The Road Price <span>(inc. Vat)</span></td></tr>
        <tr><td class="fig">&pound;129.00</td></tr>

        <tr><td class="title">Deposit</td></tr>
        <tr><td class="fig">&pound;2,514</td></tr>

        <tr><td class="title">Monthly Payment</td></tr>
        <tr><td class="fig">&pound;129.00</td></tr>

        <tr><td class="title">Representative APR</td></tr>
        <tr><td class="fig">6.7&#37;</td></tr>

        <tr><td class="title">Duration of Agrement</td></tr>
        <tr><td class="fig">36 months</td></tr>

        <tr><td><a href="#financeDetail36" role="button" class="btn btn-danger" data-toggle="modal">Launch Finance Details</a></td></tr>
    </table>
4

1 回答 1

1

您是否考虑过将其放入新的 UserControl 中?你可以有一个枚举来加载四种不同类型的数据,有一个公共属性来指定枚举,将 UserControl 放在你需要表的任何地方,然后在标记中指定属性,这样它就知道要加载哪些数据。UserControls 是在 web 表单中重用的最简单方法之一。

于 2013-06-21T15:46:30.787 回答