<% if (UserService.IsAuthenticated && !Model.Post.IsDeleted) { %>
<% Html.RenderPartial("Reply", new ReplyViewModel { Id=Model.Post.PostId, CssClass="respond" }); %>
<% } %>
and
<if condition="UserService.IsAuthenticated && !Model.Post.IsDeleted">
</if>
and <test if = ""> the variation should work and produce almost identical code:
if (UserService.IsAuthenticated && !Model.Post.IsDeleted)
{
Html.RenderPartial("Reply", new ReplyViewModel { Id=Model.Post.PostId, CssClass="respond" });
}
Maybe try to print $ {UserService.IsAuthenticated} and $ {Model.Post.IsDeleted} to be absolutely sure that the condition is not always true?
- , ... , "" - WebForms, Reply.ascx Reply.aspx? WebForms , HttpContext, , .
Spark, .