I am trying to use @Html.Sitecore().Rendering("--id--", Model.Property) to call render a staic view. It is not rendering on page.
Layout:
@Html.Sitecore().Rendering("--Myviewid--", Model)
Myview:
@model namespace.Model
@{
var list = Model.GetMyList();
}
foreach(var item in list)
{
---my logic ---
}
It executes without any exception. No errors logged in the log files. I even added a debugger to view and went through each step to see if it is breaking anywhear. Code is executed without any exception. But, view is not rendered on the page.
I also tried @Html.Sitecore().Rendering("--MyviewId--", new {Model = myModel})
.
@Html.RenderPartical
works perfectly but can anyone let me know why Sitecore().Rendering
is not working even after executing without any errors
EDIT (copied from OP's comment):
In layout there is
@if(condtion){ Html.Sitecore.Rendering }
I confirm that condition is true
and the view code is executed without error.
@{...}
around theHtml.Sitecore.Rendering
in your layout? Or is it inside some html tag like div?