Specific things will not be more said, all compiled, code is a wood problem.
Results Preview page When unexpectedly tell me compile error, this is not science AH.
Take a look at the error page
Look at the problem should probably be missing}, or more than a} upside down compilation error, but compile generation completely no problem ah, no way, since the issue, it must be the final merge generated code file there is a bug
That's where the problem is, there is no way to bite the bullet check it.
1. Show try to debug run a page, found that the background is absolutely no problem. After the return view (), the Yellow pages appear. The question should be in the HTML page, so take a look at what's on the HTML page.
General HTML, even if the wrong will not affect the compilation, not to mention the use of the auto-alignment with VS, it is possible to align the code, at a glance, there should be no problem. The question should be at the beginning. Let's take a look.
section of the page code bar
@using junph.entities.eshop@{ viewbag.title = "Clearing Center"; var contactlist = (ilist<crm_usercontact>) @ViewBag. contactlist; Crm_usercontact defaultcontact = null; if (contactlist! = null) { defaultcontact = contactlist[0];} }
This is part of the code at the beginning of the HTML page. The back of the HTML is not posted, there is no point.
To say that is the problem of curly braces, there is only one possibility, where the nesting of curly braces may be problematic. What the hell is the problem? Try to get rid of the code of Judgment first try it.
depend on, sure enough no problem, the page is at least displayed. The problem must be here.
Razor grammatical impression that this should be no problem in writing it. As a matter of fact, there is no problem with grammar.
http://blog.csdn.net/pasic/article/details/7072340
That's weird, isn't it a bug? , then changed the wording, the judgment logic is written in a separate code block (in fact, you can directly use the ternary expression?). : To avoid this problem, the main thing here is to see what it is.
@{ if (contactlist! = null ) {defaultcontact = contactlist[0];} }
Preview the page again, no problem. Oh, I can only say pit Ah, unlucky met.