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 WongRank #286 · 8.8K reputationPosted Dec 17, 2017, 5:21 PM EST
Marcelo Souza25 reputationPosted Dec 18, 2017, 8:34 AM EST
Marcelo Souza25 reputationPosted Dec 18, 2017, 8:47 AM EST
Catcher WongRank #286 · 8.8K reputationPosted Dec 18, 2017, 2:44 PM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts