Please can someone help me out? I am new to Umbraco.
I am moving a crud scenario from MVC 4 to Umbraco. I created a SurfaceController that returns a partial named “AnimalIndex”. In the template is de code:
@{ Html.RenderAction("Index", "Animal");}
That is working fine, the final page is decorated with top and bottom templates. However now we need to wire up these buttons:
@Html.ActionLink("Details", "Details", new { id = item.ID })
@Html.ActionLink("Edit", "Edit", new { id = item.ID })
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
I tried this one for Details:
<a href="@Url.Content("~/For-Sale-With-Members/Details?id="+item.ID.ToString())">Details</a>
…and pointed the link to another called Details with the “For-Sale-With-Members/Details” link. This is an awfull solution. Each time the page is renamed the links are broken.
The results of these links are pages that has bypassed by the Umbraco render engine and the link generates this error:
Server Error in '/' Application.
The "RenderBody" method has not been called for layout page "~/Views/Animal.cshtml".
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The "RenderBody" method has not been called for layout page "~/Views/Animal.cshtml".
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/70994-how-to-create-links-in-typical-crud-scenario-to-jump-from-the-index-page-to-the-detail-page-in-same-surfacecontroller