2015-02-11 77 views
0

在視圖中更改視圖中的css路徑我正在使用外部服務器託管我的css/js文件,我沒有使用MVC的捆綁。根據環境使用DI

我需要根據環境(dev/preprod/prod)將絕對路徑切換到我的css文件。

<link rel="stylesheet" type="text/css" href="http://localhost/main.css")"> 

<link rel="stylesheet" type="text/css" href="http://mystaticserver.com/main.css")"> 

根路徑是在注入的配置節中定義的。

什麼是從我的視圖訪問我的配置文件的最佳方式?

回答

0

@ System.Configuration.ConfigurationManager.AppSettings [「myKey」]