开发者

MVC @import html keyword

开发者 https://www.devze.com 2023-02-16 02:57 出处:网络
I\'m trying to use: <style>@import url(\"css/main.css\");</style> but mvc treats it as .net code in razor view. \"CS0103: The name \'import\' does not exist in the current contex开发者_

I'm trying to use:

<style>@import url("css/main.css");</style>

but mvc treats it as .net code in razor view. "CS0103: The name 'import' does not exist in the current contex开发者_Go百科t" how do i fix it? thanks


Double the @ to fix the issue:

<style>@@import url("css/main.css");</style>

More details here.


Use two @@ characters to escape them, that should fix it.

0

精彩评论

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