I've got this code in an MVC project using the WebForms view engine and I'm trying to convert it over to Spark. How can I conditionally call a partial and pass it view data?
<% if (UserService.IsAuthenticated && !Model.Post.IsDeleted) { %>
<% Html.RenderPartial("Reply", new ReplyViewModel { Id=Model.Post.PostId, CssClass="respond" }); %>
<% } %>
Tried this (to no avail, it renders the partial before all other content):
<if condition="UserService.IsAuthenticated && !Model.Post.IsDeleted">
#Html.RenderPartial("Reply", new ReplyViewModel { Id=Model.Post.PostId, CssClass="respond" });
</if>