I’d like to use the Visual Studio 2010 MVC 3 framework for a web project that hosts VXML and CCXML rather than HTML for telephony based applications.
MVC 3 seems ideally suited to this kind of application, and I think it’s a great alternative to the more widely used jsp/Tomcat based applications that are generally used for VXML/CCXML. But there are a couple of annoyances:
- The project tries to validate my .cshtml pages as HTML (understandably), or whatever target validation I set in Options>Text Editor>HTML>Validation>Target, but it forces me to have validation. I can’t seem to find a way to switch it off altogether. Is there a way to switch it off and prevent hundreds of warnings? or better still, write my own custom validation for CCXML/VXML?
- Is there a way to automatically set the content-type to “text/vxml” for all views without having to write
Response.ContentType = "text/vxml";in every Action Method?
You could write a custom view engine based on the Razor view engine and register a custom extension for your views:
and in Application_Start declare the custom extension:
and the custom build provider in web.config that will recognize the
.vxmlextension:Now you could use
.vxmlas extension for the views. Since Visual Studio doesn’t recognize the.vxmlextension, when you open a file with it, it won’t bother you with warnings. And you could even create a custom VS plugin that could provide syntax highlighting and Intellisense for this custom extension.