Hi
I need to call a controller method (this method will return TRUE or FALSE) from my view in order to show a "hands-up or hands-down" image. Bellow you will find my code. Am I in the right path? I don't have experience with ajax so every help is appreciated.
The results below are return only one image (the first line in the table), despite of the table on my Index view returning many lines. What am I doing wrong?
What should I do to my boolean method return true or false, depending on a parameter (like IdClient)? Note that in this example, I'm always returning false (just to test it...).
Controller Method:
public bool GetTrueOrFalse()
{
return false;
}
My View:
- @model IEnumerable
- @{
- ViewBag.Title = "Index";
- }
Index
- @Html.ActionLink("Create New", "Create")
class="table">
- Status
- @Html.DisplayNameFor(model => model.NmCliente)
- @Html.DisplayNameFor(model => model.Estado.NmEstado)
- @foreach (var item in Model)
- {
"ddlVerFalse"
>- @Html.DisplayFor(modelItem => item.NmCliente)
- @Html.DisplayFor(modelItem => item.Estado.NmEstado)
- @Html.ActionLink("Edit", "Edit", new { id=item.IdCliente }) |
- @Html.ActionLink("Details", "Details", new { id=item.IdCliente }) |
- @Html.ActionLink("Delete", "Delete", new { id=item.IdCliente })
- }
Thanks.
Catcher WongPosted Dec 18, 2017, 7:44 PM
Marcelo SouzaPosted Dec 18, 2017, 1:47 PM
Marcelo SouzaPosted Dec 18, 2017, 1:34 PM
Catcher WongPosted Dec 17, 2017, 10:21 PM