I have a razor mapping pattern in MVC3 for an address. The following is a coding example that I used for a single address line:
@Model.City<text>,</text>
When I put a comma right after the variable name, it creates a syntax error. Adding a <text> tag around the comma fixes the problem, but it seems a bit messy when most of the razor code is so neat and concise.
Is there a tidier and more concise way to do this?
Edit: This piece of code is inside an if block. I did not understand, but it turns out that this affects how razar parses the material.
source
share