开发者

Razor View if statement incorrect

开发者 https://www.devze.com 2023-03-16 14:14 出处:网络
My last \'if\' statement is rendering as text. How can i fix that? See how the grey highlighting for the 2nd \'if\' statement completes on the end of the last \'if\' statem开发者_JAVA技巧ent?

My last 'if' statement is rendering as text. How can i fix that?

See how the grey highlighting for the 2nd 'if' statement completes on the end of the last 'if' statem开发者_JAVA技巧ent?

Razor View if statement incorrect

thanks


Razor thinks that the previous if hasn't ended yet, since you're still inside the <div>s.

You need to prefix the <div>s with @: to prevent Razor from matching the tags.

0

精彩评论

暂无评论...
验证码 换一张
取 消