L
Lars Zeb
I cannot figure out how to pass a parameter to the Show method on the FliersController. Intellisense does not include
the "flier" variable declared in the foreach statement. If I type in "flier.ID" as the parameter, the compiler says it
cannot resolve symbol 'flier'.
As you can see, the compiler sees the symbol 'flier' in the code render block, but not in the lambda expression.
<% foreach (Flier flier in ViewData.Model) {%>
<tr>
<td> <%= flier.Description%> </td>
<td>
<%# Html.ActionLink<FliersController>(c => c.Show(flier.ID), "Details")%> //compiler error
</td>
<% }%>
In FliersController:
public ActionResult Show(Guid id) {
Flier flier = _flierRepository.Get(id);
return View(flier);
}
Thanks, Lars
the "flier" variable declared in the foreach statement. If I type in "flier.ID" as the parameter, the compiler says it
cannot resolve symbol 'flier'.
As you can see, the compiler sees the symbol 'flier' in the code render block, but not in the lambda expression.
<% foreach (Flier flier in ViewData.Model) {%>
<tr>
<td> <%= flier.Description%> </td>
<td>
<%# Html.ActionLink<FliersController>(c => c.Show(flier.ID), "Details")%> //compiler error
</td>
<% }%>
In FliersController:
public ActionResult Show(Guid id) {
Flier flier = _flierRepository.Get(id);
return View(flier);
}
Thanks, Lars