複数のタブを表示するホームページがあります。
ページの最初のタブにタブを追加しようとしていますが、jquery および ajax 呼び出しを使用してこれを行っています。タブのカウントはフェッチされたデータに依存します。
たとえば、私のホームコントローラーには、フェッチされたデータに応じて、製品、製造元タブ、および製品タブの下に表示する詳細アクションがあり、国のタブを表示しています。データはメーカータブの下に表示されています。
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<EmsAdmin.Models.abc>" %>
abc の詳細 abc の詳細 <% Html.RenderPartial("abc", Model); %>
</ul>
<div class="panes">
<!-- Products -->
<div class="pane">
<div style="clear: both;">
</div>
<% Html.RenderPartial("Products"); %>
<div style="clear: both;">
</div>
</div>
<!-- end of products-->
<% if ((Boolean)ViewData["HasWTB"])
// Do they have the Where to by product?
{ %>
<!-- where to buy -->
<div class="pane">
<div style="clear: both;">
</div>
<% Html.RenderPartial("Manufacturers"); %>
<div style="clear: both;">
</div>
</div>
<!-- end of where to buy -->
<% } %>
<!-- Request Reports see Reports.ascx-->
<div class="pane">
<div style="clear: both;">
</div>
<% Html.RenderPartial("Reports"); %>
<div style="clear: both;">
</div>
</div>
<!-- end of request reports -->
<% if ((Boolean)ViewData["HasInText"])
{ %>
<!-- In Text -->
<div class="pane">
<div style="clear: both;">
</div>
<% Html.RenderPartial("InText"); %>
<div style="clear: both;">
</div>
</div>
<!-- end of in text -->
<% } %>
<!-- Ranges or SubBrands -->
<div class="pane">
<div style="clear: both;">
</div>
<% Html.RenderPartial("Ranges"); %>
<div style="clear: both;">
</div>
</div>
<!-- end of ranges of SubBrands -->
<!-- Ranges or Region -->
<div class="pane">
<div style="clear: both;">
</div>
<% Html.RenderPartial("Regions"); %>
<div style="clear: both;">
</div>
</div>
<!-- end of ranges of Regions -->
<!-- Categories -->
<div class="pane">
<div style="clear: both;">
</div>
<% Html.RenderPartial("Categories"); %>
<div style="clear: both;">
</div>
</div>
<!-- end of Categories -->
<!-- REgions -->
<div class="pane">
<div style="clear: both;">
</div>
<% Html.RenderPartial("REgions"); %>
<div style="clear: both;">
</div>
</div>
<!-- end ofFilters -->
</div>
</div>
<script type="text/javascript">
//<![CDATA[
// Set the tabs to be tabs
$(function () {
// setup ul.tabs to work as tabs for each div directly under div.panes
$("ul.tabs").tabs("div.panes > div");
});
//]]>
</script>