I am stuck & want to get selected the select option.
<select class="form-control" data-live-search="true" id="itemb">
<option data-tokens="All">All</option>
@foreach (var item in ViewBag.brandCategories)
{
<option>@item.brandName</option>
}
</select>
//search by brand name..
$("#itemb").change(function () {
var typp = document.getElementById("typ").value;
var type = encodeURIComponent(typp);
var brand = this.value;
window.location.href = '/mobiles_tablets/item/?type=' + type + '&search=' + brand;
});
In the above code just i get list in @foreach through @viewBag .but now I want when it return to the view it should get selected value.
please write js code?
Thanks.