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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -