I am starting to use Asp.net MVC. It is recommended to use tags <%and %>to insert the source code in HTML, because it is easier to read.
Unfortunately, although Visual Studio cannot detect errors during compilation. This is very bad.
For example:
<body>
<form action="LogOn.aspx">
<div>
<div><label for="txtLogOn_UserName"><%= LogOnView.UserName %> :</label></div>
<div><%= Html.TextBox("txtLogOn_UserName")%></div>
</div>
</form>
</body>
How can I be sure that LogOnView.UserNameis a valid statement? By analogy, the code is similar to JS code; you cannot know if there will be errors until you run them.
A possible solution may be to create a test project, but I do not like this idea, and I do not think that I will need to create a test project to solve this problem.
. , .