Just to expand a bit on the answer by @fedri .....
Since you have so many dropdowns, I strongly suggest you make use of a viewmodel class to organise the dropdowns. (I won't go into why you have so many dropdowns, as it does seem like an excessive amount, But I guess the design has it's reasons).
Firstly, a viewmodel is simply a class
e.g.
public class IndexViewModel
{
public List<SelectListItem> Dropdown1 { get; set; }
public string Dropdown1SelectedItem { get; set; }
}
I make use of this viewmodel by passing an instance of it to the view.
public class HomeController : Controller
{
public ActionResult Index()
{
var viewModel = new IndexViewModel();
viewModel.Dropdown1 = new List<SelectListItem>();
viewModel.Dropdown1.Add(new SelectListItem() { Text = "Item 1", Value = "23" });
return View(viewModel);
}
}
@model WebApplication3.Controllers.IndexViewModel
@using (Html.BeginForm())
{
@Html.DropDownList(nameof(Model.Dropdown1SelectedItem), Model.Dropdown1, "Select item...")
<input type="submit" value="Save" />
}
When I post back the data, the selected value of Dropdown1
is stored in Dropdown1SelectedItem
.
[HttpPost]
public ActionResult Index(IndexViewModel viewModel)
{
//viewModel.Dropdown1SelectedItem will contain the Value property of the item you selected.
return View();
}
That's simple enough to get you up and running. The hard part is organising your viewmodel to cater for so many dropdowns, in case you end up getting lost. However, if you name the dropdown properties well enough, then I guess it shouldn't be too bad.
EDIT:
If you must pass dropdown data back via AJAX/jQuery, rather then a from postback, then I can't see how not using a JSON structure to pass the data will work. In that case, I would strongly look at the design and review whether 100+ dropdowns is sensible to be posting back data for in one hit.