私はasp.netmvc3の初心者です。ユーザーが検索項目を入力し、データベースからデータを取得できるページを作成したいと思います。データベースを作成しました。私は次のコントローラーを作成しました:
public ActionResult SearchIndex(string id)
{
string searchString=id;
var search = from m in db.Searches
select m;
if (!String.IsNullOrEmpty(searchString))
{
search = search.Where(s => s.Name.Contains(searchString));
}
return View(search);
}
ビューページから上記のコントローラーに値を渡したい。上記のコントローラーから検索するアイテムを入力するためのビューページのコードは何ですか?