[HttpGet]
public ActionResult Index(string Section)
{
var query = from v in context.Schedules
where v.Section == Section
select v;
return View(query);
}
I have this at Index.cshtml
Select your Section:
@Html.RadioButton("Section", "All", true, new { onclick = "showResult(this)"}) All
@Html.RadioButton("Section", "Device", false, new { onclick = "showResult(this)"}) Device
@Html.RadioButton("Section", "Sensoric", false, new { onclick = "showResult(this)"}) Sensoric
@Html.RadioButton("Section", "SMT", false, new { onclick = "showResult(this)"}) SMT
@Html.RadioButton("Section", "Test System Built", false, new { onclick = "showResult(this)"}) Test System Built
with is JavaScript as:
such that when user clicks each Device, Sensoric, SMT and Test System Built radio button, those data from Device, Sensoric, SMT and Test System Built are displayed correctly.
How about when user clicks the 'All' radio button? I want all those data from Device, Sensoric, SMT and Test System Built to be displayed.
How should I modify the code? And the 'All' radio button to be checked from the Index.chtml first load, such that all data is loaded.
thanks.

Ashish ShuklaRank #458 · 5.5K reputationPosted Mar 29, 2013, 2:31 AM EDT
Please let me know if this answers your question.
TAN WhoAMIRank #5,790 · 286 reputationPosted Mar 29, 2013, 6:05 AM EDT