Conditionally showing span in ASP.Net MVC -
i have following..
<span class="error">@model.errormessage</span>
the problem css error class makes yellow box showing when errormessage empty.
is there best practice handling this? thinking of @if (using razor) seems odd have logic in view.
it seems odd have logic in view.
view have view logic in it. mvc not mvp or mvvm code behind discouraged. believe having if
in view quite normal.
alternative have model (view model) have property set css class of span
. if error empty, css class have display:none;
Comments
Post a Comment