Associate
- Joined
- 2 Sep 2007
- Posts
- 1,997
Hi All
Ignore the crap look I'll work on that later. If a user types in an value into the textbox and clicks search I want to use that value to filter the dropdownlist which is bound to an dbset (entity framework). Any ideas? I assume I need to write some code in the ActionResult? Or am I wrong?
Ignore the crap look I'll work on that later. If a user types in an value into the textbox and clicks search I want to use that value to filter the dropdownlist which is bound to an dbset (entity framework). Any ideas? I assume I need to write some code in the ActionResult? Or am I wrong?
PHP:
public ActionResult Search(string name)
{
//some operations goes here
return View(); //return some view to the user
}
PHP:
<body>
<div>
@using (Html.BeginForm("Search", "Home"))
{
@Html.TextBox("name")
<input type="submit" value="Search" />
}
@using (Html.BeginForm())
{
@Html.LabelFor(x => x.SelectedApplicationId)
@Html.DropDownList("SelectedApplicationId", new SelectList(Model.PeopleUnits, "ID", "UNIT_INSTANCE_CODE"))
}
</div>
</body>