views:

48

answers:

2

We're seeing the above warning on a View's form post...

<form action="../ControllerName/ActionMethodName" method="post">

Technically this warning is correct - there is no such file, but as we're using ASP.NET MVC this check isn't really sufficient.

This warning isn't stopping our application from working but we have a general "no compiler warnings" policy so would like to suppress it.

Is this possible?

+1  A: 

Don't write the form-tag out, use Html.BeginForm() instead.

svinto
A: 

I think there is some functionality in VS 2008 where you can specify specific Warnings to suppress. The compiler error should give a warning level and number which you can put in the Suppress Warnings box in the build properties of your project. Right-click your warning and select Show Error Help. You can get the warning level and number from there.

Not sure if this is available for VS 2005 though.

**Edit: just checked in VS 2005 and should exist as well.

David Liddle

related questions