Visual Studio ASPX Files Synthax Highlight out of Wack
I've just startedw working with ASP.NET MVC 2, and I have a question regarding ASPX syntax highligting in Visual Studio.
Often I want to generate some serverside content witin quotes, for example
<a href="<% c# code %>"> foo </a>
But Visual Studio highlights this incorrectly, causing warnings and other problems. See attached image, which shows Url.Action
as string and "Collage" as object... Am I doing something silly here? Or is this how things are supposed to be?
http://img560.imageshack.us/img560/7898/screenuk.png
PS. 开发者_如何学GoI'm well aware about the unnecessary code duplication in the provided example. I just wanted to try something. And this is actually a big part of the problem, because when Visual Studio gets confused it confuses me too! If I were to generate those lines with a for loop, that highlights as a string, the code feels very messy.
Due to a fundamental limitation in the VS editor, this unfortunately doesn't work
精彩评论