Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: Code inside templates inside conditional attributes fail to compile [622]

$
0
0
It's a bit of an obscure edge case, but we managed to hit it in the NuGet Gallery :). Run the attached page as a Razor v2 page.

EXPECTED: Renders a text box saying "hihihihihihi..." (repeated 10 times)
ACTUAL: CS1002: ; expected

There is a workaround: Just take the value you are generating in the conditional attribute and calculate it in a variable, then render the variable inside the conditional attribute.
Comments: My own note, this was a regression between Razor v1 and v2.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>