项目作者: ibrahimozgon

项目描述 :
Adds inline content files to html output
高级语言: C#
项目地址: git://github.com/ibrahimozgon/Asp.net-View-Inline-Content-Helper.git


InlineContentHelper

Adds inline content files to html output
You can use this library to draw critical css or js files to html output in asp.net mvc projects
You can find details about critical css here

Usage

  1. @using InlineContentHelper.Helpers
  2. <html>
  3. <head>
  4. @Html.InlineStyles("critical-style")
  5. @Html.InlineScripts("critical-script")
  6. </head>
  7. </html>

Path

You need to add your files under Contents folder
Contents

  1. => script
  2. =>critical-script.js
  3. =>critical-script.mobile.js
  4. => style
  5. =>critical-style.js
  6. =>critical-style.mobile.js

Mobile View Support

Like ASP.NET MVC Dislay Mode support, InlineContentHelper also support different files in different display mode.
If you use

  1. @Html.InlineStyles("critical-style")

library adds .mobile extension for mobile page rendering.

Caching

Library cache inline-files after first fetch. It uses dictionary to cache string items. You can look at FirstLevelCacheManager