Core 3.0 The tag helper 'option' must not have C# in ...

2,469 阅读1分钟

在写 .Net Core3.0的 Razor视图使用C#语法时提示的警告 The tag helper 'option' must not have C# in the element's attribute declaration area. 有一些Html标签比如:select 的 option不能使用C#的语法

找到的解释是由于新处理器试图强制它使用标记助手造成的,具体是什么原因咋也不知道 解决的方案是在标签上加个! 转义为纯Html: