@model IEnumerable<State>
@{
ViewBag.Title = "Index";
}
<h2>State Data</h2>
<p>
@Html.ActionLink("Create New", "CreateState")
</p>
<p>
@using (Html.BeginForm())
{
<p>
Search by Name: @Html.TextBox("searchstring") <br/>
<input type="submit" value="Filter"/>
</p>
}
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Station)
</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Station)
</td>
<td>
@Html.ActionLink("Update State Data", "UpdateStation", new {id = item.Id}) |
@Html.ActionLink("Delete", "DeleteState", new {id = item.Id}) | Select to Include in Charts
</td>
</tr>
}
</table>
This is my code, i need to input a @Html.Checkbox()
for every item, then pass the values of the selected items to the controller and create a chart with those values..
I know how to make the chart, i just don't know how to use the checkbox and pass the values.
{
[Table("State")]
public class State
{
public State()
{
Orders = new HashSet<Order>();
}
public int Id { get; set; }
[Required]
[StringLength(50)]
[Display(Name = "State")]
public string Name { get; set; }
[Required]
public int Station { get; set; }
public virtual ICollection<Order> Orders { get; set; }
}
}