In my view like that in debug mode to view Site.css use her, and when compiled in release mode the view using CSS-min.css site.
Something like this:
# if (Debug)
/ / CSS
# elif (R开发者_如何学Goelease)
/ / CSS Min-
# endif
But in my view .cshtml
You can use Context.IsDebuggingEnabled
. This boolean property is controlled by the debug attribute from the compilation section in web.config.
Here's a sample for your view.cshtml :
if (Context.IsDebuggingEnabled)
{
// use something.css
}
else
{
// use something.min.css
}
asp.net mvc - Razor view engine, how to enter preprocessor(#if debug) - Stack Overflow
How about this?
精彩评论