2011-02-08 14 views
0

ページの異なるテーブルとdiv要素をユーザーコントロールに変更したいので、フロントエンドが非常に複雑になっているのではなく、パーシャルビューとしてレンダリングできます。ページ上の要素をユーザーコントロールに変更する

一つの例は、この表のようになります。

<table id="summaryInformation" class="resultsGrid" cellpadding="2" cellspacing="0"> 
       <tr> 
        <td id="EffectiveDateLabel" class="resultsCell"> 
         <%= Html.LabelFor(m => m.EffectiveDate) %> 
        </td> 
        <td id="EffectiveDateValue" class="alignRight"> 
         <%= Model.EffectiveDate.Value.ToString(Chatham.Web.Data.Constants.Format.DateFormatString) %> 
        </td> 
        <td id ="NotionalLabel" class="resultsCell"> 
         <%= Html.LabelFor(m => m.Notional) %> 
        </td> 
        <td id="NotionalValue" class="alignRight"> 
         <span> 
          <%= Chatham.Enumerations.CurrencyHelper.GetFriendlyName((Chatham.Enumerations.Currency)Model.FloatingComponent.CurrencyID.Value) %> 
         </span> 
         <%= Model.Notional.Value.ToString(Chatham.Web.Data.Constants.Format.CurrencyCentsIncludedFormatString) %> 
        </td> 
       </tr> 
       <tr> 
        <td id="MaturityDateLabel" class="resultsCell"> 
         <%= Html.LabelFor(m => m.MaturityDate) %> 
        </td> 
        <td id="MaturityDateValue" class="alignRight"> 
         <%= Model.MaturityDate.Value.ToString(Chatham.Web.Data.Constants.Format.DateFormatString)%> 
         - 
         <%= Model.AmortizationComponent.MaturityBusinessDayConvention%> 
        </td> 
         <td id="Td3" class="resultsCell"> Holiday City</td> 
         <td id="ddlHolidayCity" colspan="3"> 
        <%for(int i = 0; i < Model.Trx.TransactionHolidayCityCollection.Count; i++){%><%=i > 0 ? "," : ""%> 
         <%=DropDownData.HolidayDays().ToList().Find(item => item.Value == Model.Trx.TransactionHolidayCityCollection[i].HolidayCityID.Value.ToString()).Text%><%} 
        %> 
        </td> 
        <td> 
       </tr> 
       <tr > 
        <td id="TimeStampLabel" class="resultsCell"> 
         Rate Time Stamp 
        </td> 
        <td id="Timestamp" class="alignRight"> 
         <%= Model.StateBag.CurveDate.TimeStamp.ToString(Chatham.Web.Data.Constants.Format.DateTimeFormatString) %> 
        </td> 
       </tr> 
      </table> 

は、どのように私は、フロントエンドでの部分図としてこれをレンダリングする方法を、ユーザーコントロールにこれを変更してますか?

ありがとうございます!

答えて

0

それぞれのtable要素をとり、それを独自の.aspxファイルに入れて、同じファイルを一番上にインポートし、部分ビューとして代わりにレンダリングします。

関連する問題