开发者

Using #pragma statement in Razor View

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜