How to make a DropDown Bind
Microsoft Net Framework

Frist you can make the database Table in the Dropdown you have enter the project name with database.
   
  you enter the database in Controller
   
   you  enter in action you make the list with object and make the new list and write table name with table id and table name.
      List<SelectListItem> list = new SelectList(db.streetgates, "StreetID", "StreetName").ToList();
            ViewBag.address = list;
                return View();
   go to view you label the name you have write

<div class="col-md-3">
    <div class="form-group">
        <label class="control-label" for="vouchertypeid">Select Street</label>
        @Html.DropDownListFor(a=>a.StreetID, (IEnumerable<SelectListItem>)ViewBag.address, "Select",new { @class="form-control"})
    </div>
</div>

 In dropdown you make the object with table id

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM