私の検索ページには多くのパラメーターがあり、このページには現在の検索用のフィルターがいくつかあります。
ルートの値の一部を変更したいだけです。
例:
http://www.example.com/{controller}/{action}/{brand}/{model}/{color}/{price}
私の検索ページには、色と価格を変更できるフォームがあります。
HTML:
@using (Html.BeginForm("action", "controller", FormMethod.Post))
{
@Html.DropDownListFor(m => m.Color, Model.Colors)
@Html.DropDownListFor(m => m.Price, Model.Prices)
<input type="submit" value="Search" />
}
コントローラ:
[HttpPost]
public ActionResult Action(SearchModel search)
{
//I can get the Price and Color
string color = search.Color;
string price = search.Price;
//Now I want to get the values of brand and model
return RedirectToRoute("Action",new
{
controller = "Controller",
action = "Action",
color = color,
price = price,
brand = ????,
model = ????
});
}
私の検索にはこれよりも多くのパラメーターがあります...隠しフィールドに入れてモデルと一緒に送信したくありません:\
ありがとう