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

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book