There is a table of products, each product has a group, for example (Fruit, Cereal, Beverage).
I want to create a search box with a dropdown list.
When a fruit is selected in the dropdown list, I want it to change instantly and list the Fruits.
Thanks
@Html.DropDownList("GRUP", (List<SelectListItem>)ViewBag.grup, "", new { })
<button class="btn btn-secondary">Ara</button>
public ActionResult Urunler(int? id, int? kimlik)
{
var ad = (string)Session["FIRMAKODU"];
ViewBag.firma = ad;
var plasiyerid = (string)Session["PLASIYERID"];
ViewBag.plasiyer = plasiyerid;
ViewBag.cariid = id;
ViewBag.fisid = kimlik;
List<SelectListItem> grup = (from x in db.WEBSTOK
group x by x.GRUP into g
select new SelectListItem
{
Text = g.Key,
Value = g.Key.ToString()
}).ToList();
ViewBag.grup = grup;
var stok = db.WEBSTOK.Where(x => x.FIRMA == ad & x.PLASIYER == plasiyerid).ToList();
return View(stok);
}