Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Suppress Conditional Attribute Warnings

$
0
0

I'm working on a Razor v2 Web Pages site in VS 2013 Express for Web, and a lot of my pages include markup like the following:

<input type="text" name="SomeField" disabled="@SomeDAO.DisableSomeField()" /><select name="SomeSelect"><option value="0" selected="@(SomeDAO.SomeSelectValue == 0)">Zero</option><option value="1" selected="@(SomeDAO.SomeSelectValue == 1)">One</option></select>

Problem is, all of those conditions on the disabled and selected attributes aren't recognized as valid by the compiler, so I've got a pretty massive stack of warnings of the form "'@SomeDAO.DisableSomeField()' is not a valid value of attribute 'disable'".

While it's not causing any problems in the actual execution of the program (The boolean expressions evaluate just fine at runtime and enable/disable/select the right things), it would be nice to suppress these warnings so that I could focus on any others that could actually be problematic.  Anyone have thoughts on how to do that?


Viewing all articles
Browse latest Browse all 3509

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>