Most of my web background for web programming is PHP, so ASP.NET MVC was the logical choice for our latest web application, which also needed to work as a background addition to a standalone Winforms application. However, we continue to find ourselves along the road that we usually follow in php - repeating a lot of tags for conditional output. Is this a bad idea in ASP.NET MVC?
For example, without Response.Write:
<%if (OurUserSession.IsMultiAccount) {%> <%=Html.ActionLink("SwitchAccount", "Accounts", "Login") %><span>|</span> <%}%>
With Response.Write:
<%if (OurUserSession.IsMultiAccount) Response.Write (Html.ActionLink("Swith Account", "Accounts", "Login") + "<span>|</span>"); %>
The difference here is quite insignificant, but sometimes our presentation logic becomes more complex (a very complex presentation logic, that is, something more than logical, we just unload the controller). The second seems easier to read, but I wanted to see if there were any thoughts on this.
source share