現在、設定ページから検索ボックスのあるページ ページにいくつかの構成設定を渡す必要がある Web アプリを作成しています。
現在、設定ページからホームページに構成データを次のように渡しています。
public ActionResult Settings(Configuration configuration)
{
return RedirectToAction("ConfigSet", "Home", configuration);
}
そしてホームコントローラーで:
public ActionResult ConfigSet(Configuration configuration)
{
return View("Index");
}
私は部分的なビューを生成しています:
public PartialViewResult Search(string q)
{
List<Stuff> results = this.Search(q);
return PartialView("SearchResults", results);
}
部分ビューが次のようにレンダリングされます。
@using (Ajax.BeginForm("Search", "Home", new AjaxOptions {
HttpMethod = "GET",
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "searchResults",
}))
{
<input type="text" name="searchString" />
<input type="submit" value="Search" />
}
私の質問は、構成設定を部分ビューに渡すにはどうすればよいですか? 私はこれについて数日間考えていて、本当に混乱しています。