MVC Development Razor Mode considerations

Source: Internet
Author: User

1 Scenario: The MVC pattern developed by the. cshtml screen, there is a @if statement inside, if the statement inside there are other code, the screen always error: If the module does not correspond to the "}", what problem

After tracking, the decision CS Statement No problem, that is the screen JS error? At first, the idea was this.

Later, after careful check, found that if the statement of many},{} are paired appear

But I found a situation, that is, some if statement {} These two symbols, can correspond to each other, but some {} mouse select one, the other is not selected, then I will be the if the middle of all the statements are deleted, found that can correspond to each other, and then i a sentence of the network add, the problem finally found! It turns out that the comment statement in the. cshtml file, @if, cannot be annotated with <!----this way!!!

MVC Development Razor Mode considerations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.