@{
    int columnId = Html.CurrentColumnId();
    dynamic infoData = Html.InfoData();
    dynamic prevData = Html.InfoDataPrevious(columnId, (int)infoData.Id);
    dynamic nextData = Html.InfoDataNext(columnId, (int)infoData.Id);
    string relativeIds = infoData.RelativeIds;//获取相关产品的ids；
}
<div class="container padding-top-20">
    <div class="row">
        <div class="col-md-3">
            @Html.Partial("subNavPartial")
        </div>
        <div class="col-md-9">
            @Html.Partial("BreadcrumbPartial")
            <div class="clearfix product-content">
                <div>
                    <!--图片组-->
                    @Html.Partial("DetailImagesModel", Html.AttachmentDataList(new { ParentTable = "product", ParentField = "images", ParentId = (int)infoData.Id }))
                </div>
                <div class="detail padding-top-20">
                    <div class="title">产品介绍</div>
                    <div class="info-content padding-top-20">
                        @Html.Raw(infoData.Content)
                    </div>
                </div>
            </div>
            <div class="clearfix padding-top-20 line-height-2">
                <ul>
                    @if (prevData != null)
                    {
                        string url = Html.InfoDataUrl((int)prevData.ColumnId, (int)prevData.Id);
                        <li class="text-gray">上一篇：<a href="@url">@prevData.Title</a></li>
                    }
                    @if (nextData != null)
                    {
                        string url = Html.InfoDataUrl((int)nextData.ColumnId, (int)nextData.Id);
                        <li class="text-gray">下一篇：<a href="@url">@nextData.Title</a></li>
                    }
                </ul>
            </div>
            <!--相关推荐-->
            @if (!string.IsNullOrEmpty(relativeIds))
            {
                <div class="recommend">
                    <div class="public-title">
                        相关推荐
                    </div>
                    @{
                        var relativeList = Html.InfoDataList(new { Table = "product", ShowNumber = 8, OrderBy = "thedate desc" }, "id in(" + relativeIds + ")");
                        <div class="images-list imgae-same-size padding-top-20" id="productList">
                            <div class="row">
                                @foreach (dynamic item in relativeList)
                                {
                                    string url = Html.InfoDataUrl((int)item.ColumnId, (int)item.Id);
                                    string thumbnail = item.Thumbnail;
                                    <div class="col-md-3 col-sm-4 col-xs-6 item">
                                        <a href="@url" target="_blank"><img src="@thumbnail" alt="@item.Title"></a>
                                        <a href="@url" target="_blank" class="text-center line-height-3 font-weight-600">
                                            @item.Title
                                        </a>
                                    </div>
                                }
                            </div>
                        </div>
                    }
                </div>
                        }

        </div>
    </div>
</div>
<script type="text/javascript">
    var $lb_clicks = $("#lb_clicks");
    $.post("/E/InfoData/AddClicks", { ColumnId:@infoData.ColumnId,Id:@infoData.Id}, function (data) { $lb_clicks.text(data)})
</script>