开发者

Using #pragma statement in Razor View

开发者 https://www.devze.com 2023-03-30 22:42 出处:网络
We have some files with the jQuery vsDoc includes like this for syntax help; @if (false) { <script src=\"@Url.Content开发者_开发问答(\"~/Scripts/jquery.validate-vsdoc.js\")\" type=\"text/javascrip

We have some files with the jQuery vsDoc includes like this for syntax help;

@if (false)
{
    <script src="@Url.Content开发者_开发问答("~/Scripts/jquery.validate-vsdoc.js")" type="text/javascript"></script>
}

And it generates some annoying compiler warnings about unreachable code, I would like to wrap that statement with a #prama warning but I cant figure out the syntax in Razor.

Thanks!


@{ #pragma warning disable } 
@if (false)
{
    <script src="@Url.Content("~/Scripts/jquery.validate-vsdoc.js")" type="text/javascript"> </script>
}
@{ #pragma warning restore }

Works for me


I think this should work...

@{#pragma warning disable}
0

精彩评论

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