I am creating an "advanced input form" with a lot of inputs for searching data. My question is: What is the best way to pass a lot of data from HTML to the controller.
The reason i ask is. Lets say you have this HTML form:
@using (Html.BeginForm("Loading", "AdvancedSearch"))
{
<input type="text" id="keyword">
<input type="text" id="keyword1">
<input type="text" id="keyword2">
<input type="text" id="keyword3">
<input type="text" id="keyword4">
<input type="text" id="keyword5">
<input type="text" id="keyword6">
<input type="text" id="keyword7">
<input type="text" id="keyword8">
<input type="text" id="keyword9">
<input type="submit" value="Search" style="width: 150px;" />
}
Then it will be pretty nasty to pass it all to the controller like this (I've got a lot more keywords):
public ActionResult Loading(string keyword1, string keyword2, string keyword3, string keyword4, string keyword5, string6
string keyword7, string keyword8, string keyword9){
//do things to the parameters!
return View();
}
So how would you perform this action or would you do it like this?
Thanks!