How to fill Combo box using View Bag

 <div class="row" style="margin-top:5px;">
                    <div class="col-lg-3">Customer</div>
                    <div class="col-lg-3">
                        @Html.DropDownList("Customer", null, "Select Customer", htmlAttributes: new { id = "custId", @class = "form-control", style = "width:137px;Height:30px" })
                    </div>
                </div>

 MangoEntities mog = new MangoEntities();//Entity 

   ViewBag.Customer = new SelectList(mog.tbl_CustomerMaster, "CustomerCode", "CustomerName");//Customer Combo box

Comments

Popular Posts