mvc 5 find the length of viewbag in cshtml

mvc 5 find the length of viewbag in cshtml

<div class="row">
    <div class="col-lg-12">
        @if (ViewBag.ProDetail != null && (int)ViewBag.ProDetail.Count < 2)
        {
            <div class="well-2">
                <div class="row">
                    @foreach (var pro in ViewBag.ProDetail)
                    {
                        <div class="col-lg-4 border-boxing-cls">
                            <section class="well inner-set">
                                <h2 class="ra-well-title">@pro.NickName</h2>

                                <div>
                                    <div class="list-group even-odd-1">
                                        <div class="list-group-item">MobileNo<span class="pull-right">@pro.MobileNo</span></div>
                                        <div class="list-group-item">IMSI<span class="pull-right">@pro.IMSI</span></div>
                                        <div class="list-group-item">NickName<span class="pull-right">@pro.NickName</span></div>
                                        <div class="list-group-item">Product<span class="pull-right">@pro.Product</span></div>
                                        <div class="list-group-item">Network<span class="pull-right">@pro.Network</span></div>
                                    </div>
                                </div>
                            </section>
                        </div>
                    }
                </div>
                </div>
        }
        else
        {
            @(Html.Kendo().Grid((IEnumerable<PCX.Entities.Model.proc_Provisioning_Details_Result>)ViewBag.ProDetail)
                .Name("ServicesDetails")
                .Sortable()
                .Pageable()
                .Scrollable()
                .Selectable(e => e.Mode(GridSelectionMode.Single))
                .Columns(columns =>
                {
                    columns.Bound(e => e.MobileNo);
                    columns.Bound(e => e.IMSI);
                    columns.Bound(e => e.NickName);
                    columns.Bound(e => e.ProductType);
                    columns.Bound(e => e.UsageIncludedType);
                    columns.Bound(e => e.Network);
                })
                .DataSource(dataSource => dataSource
                    .Server()
                .Model(model =>
                {
                    model.Id(p => p.ID);
                })
            )
            )
        }
    </div>

    </div>
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.