Load css dynamically in asp.net?

后端 未结 3 1818
借酒劲吻你
借酒劲吻你 2020-12-17 01:33

I\'m creating a content management system where a user can select a css file from their server and the application will parse and store the css. The application will need t

3条回答
  •  没有蜡笔的小新
    2020-12-17 02:30

    Make a controller which serves the CSS content:

    
    

    Controller code:

    public class ServeController: Controller
    {
        public ContentResult GetCss(string id)
        {
            string cssBody = GetCssBodyFromDatabase(id);
            return Content(cssBody, "text/css");
        }
    }
    

提交回复
热议问题