Material ripple
PACE.js loader
RTL support
RTL mode
Theme settings panel
PAGE LAYOUT
LAYOUT OPTIONS
{{option[1]}}
Fixed navbar
Fixed footer
Reversed
Collapsed sidenav
THEME
NAVBAR BG
{{option}}
SIDENAV BG
{{option}}
FOOTER BG
{{option}}
using System.Web.Optimization; using System; using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; using Glob; using BundleTransformer.Core.Bundles; using BundleTransformer.Core.Orderers; using BundleTransformer.Core.Resolvers; namespace AspnetMvcStarter { public class BundleConfig { // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { // bundles.UseCdn = true; // BundleTable.EnableOptimizations = true; // Replace a default bundle resolver in order to the debugging HTTP handler // can use transformations of the corresponding bundle BundleResolver.Current = new CustomBundleResolver(); // ------------------------------------------------------------------------------------ // Application assets // bundles.Add(SassBundle("~/bundle/css/main").Include("~/Content/main.scss")); bundles.Add(new ScriptBundle("~/bundle/js/main").Include("~/Scripts/main.js")); // Bundle jquery-validation-unobtrusive package bundles.Add(new ScriptBundle("~/bundle/vendor/js/jquery-validation-unobtrusive/jquery-validation-unobtrusive").Include( "~/node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js")); // ------------------------------------------------------------------------------------ // Core stylesheets // {% if not settingsPanel -%} bundles.Add(SassBundle("~/bundle/vendor/css/bootstrap{% if style == 'material' %}-material{% endif %}").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/bootstrap{% if style == 'material' %}-material{% endif %}.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/appwork{% if style == 'material' %}-material{% endif %}").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/appwork{% if style == 'material' %}-material{% endif %}.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-{{theme}}{% if style == 'material' %}-material{% endif %}").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-{{theme}}{% if style == 'material' %}-material{% endif %}.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/colors{% if style == 'material' %}-material{% endif %}").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/colors{% if style == 'material' %}-material{% endif %}.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/uikit").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/uikit.scss")); {%- else -%} bundles.Add(SassBundle("~/bundle/vendor/css/bootstrap").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/bootstrap.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/bootstrap-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/bootstrap-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/appwork").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/appwork.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/appwork-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/appwork-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/colors").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/colors.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/colors-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/colors-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/uikit").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/uikit.scss")); // Themes bundles.Add(SassBundle("~/bundle/vendor/css/theme-air").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-air.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-air-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-air-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-corporate").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-corporate.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-corporate-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-corporate-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-cotton").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-cotton.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-cotton-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-cotton-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-gradient").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-gradient.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-gradient-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-gradient-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-paper").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-paper.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-paper-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-paper-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-shadow").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-shadow.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-shadow-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-shadow-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-soft").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-soft.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-soft-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-soft-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-sunrise").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-sunrise.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-sunrise-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-sunrise-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-twitlight").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-twitlight.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-twitlight-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-twitlight-material.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-vibrant").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-vibrant.scss")); bundles.Add(SassBundle("~/bundle/vendor/css/theme-vibrant-material").Include("~/Vendor/css{% if rtlSupport %}/rtl{% endif %}/theme-vibrant-material.scss")); {%- endif %} // ------------------------------------------------------------------------------------ // Automatically bundle ~/Vendor/js directory // // Bundle path: ~/bundle/vendor/js/{filename} foreach (string[] bundleFile in GetVendorBundles("js", "js", "**/*", "js")) { bundles.Add(new ScriptBundle(bundleFile[0]).Include(bundleFile[1])); } // ------------------------------------------------------------------------------------ // Automatically bundle ~/Vendor/css/pages directory // // Bundle path: ~/bundle/vendor/css/pages/{filename} foreach (string[] bundleFile in GetVendorBundles("css\\pages", "css/pages", "**/*", "scss")) { bundles.Add(SassBundle(bundleFile[0]).Include(bundleFile[1])); } // ------------------------------------------------------------------------------------ // Automatically bundle ~/Vendor/fonts directory // // Bundle path: ~/bundle/vendor/fonts/{filename} foreach (string[] bundleFile in GetVendorBundles("fonts", "fonts", "*", "css")) { bundles.Add(new StyleBundle(bundleFile[0]).Include(bundleFile[1], new CssRewriteUrlTransform())); } // ------------------------------------------------------------------------------------ // Automatically bundle ~/Vendor/libs directory // // Bundle path: ~/bundle/vendor/css/{libdir}/{filename} foreach (string[] bundleFile in GetVendorBundles("libs", "css", "**/*", "scss")) { if (bundleFile[2] == "true") { bundles.Add(SassBundle(bundleFile[0]).Include(bundleFile[1], new CssRewriteUrlTransform())); } else { bundles.Add(SassBundle(bundleFile[0]).Include(bundleFile[1])); } } // Bundle path: ~/bundle/vendor/js/{libdir}/{filename} foreach (string[] bundleFile in GetVendorBundles("libs", "js", "**/*", "js")) { bundles.Add(new ScriptBundle(bundleFile[0]).Include(bundleFile[1])); } } private static Bundle SassBundle(string path) { return new CustomStyleBundle(path) { Orderer = new NullOrderer() }; } private static string[][] GetVendorBundles(string sourcePath, string bundlePath, string globPattern, string ext) { // Application root directory path string APP_PATH = AppDomain.CurrentDomain.BaseDirectory; // DirectoryInfo dirInfo = new DirectoryInfo(APP_PATH + "\\Vendor\\" + sourcePath); IEnumerable
contents = dirInfo.GlobFiles(globPattern + "." + ext); List
bundles = new List
(); Regex normalizeRegex = new Regex("\\\\"); sourcePath = normalizeRegex.Replace(sourcePath, "/") + "/"; Regex pathRegex = new Regex(".*?" + Regex.Escape("/Vendor/" + sourcePath)); Regex nameRegex = new Regex("\\." + Regex.Escape(ext) + "$"); Regex urlRewriteTestRegex = new Regex("/(" + "minicolors/minicolors" + "|" + "blueimp-gallery/gallery-video" + "|" + "blueimp-gallery/gallery" + "|" + "jstree/themes/default/style" + "|" + "jstree/themes/default-dark/style" + "|" + "photoswipe/photoswipe" + ")\\.scss$"); foreach (FileInfo file in contents) { string filePath = pathRegex.Replace(normalizeRegex.Replace(file.FullName, "/"), ""); string relativeBundlePath = "~/bundle/vendor/" + bundlePath + "/" + nameRegex.Replace(filePath, ""); string relativeSourcePath = "~/Vendor/" + sourcePath + filePath; bool urlRewrite = urlRewriteTestRegex.IsMatch(relativeSourcePath); bundles.Add(new string[] { relativeBundlePath, relativeSourcePath, urlRewrite ? "true" : "false" }); } return bundles.ToArray(); } } }
@ViewBag.Title - Asp.Net MVC Starter
@Styles.Render("~/bundle/vendor/fonts/ionicons") {% if settingsPanel -%} @Styles.RenderFormat(@"
", "~/bundle/vendor/css/bootstrap{% if style == 'material' %}-material{% endif %}") @Styles.RenderFormat(@"
", "~/bundle/vendor/css/appwork{% if style == 'material' %}-material{% endif %}") @Styles.RenderFormat(@"
", "~/bundle/vendor/css/theme-{{theme}}{% if style == 'material' %}-material{% endif %}") @Styles.RenderFormat(@"
", "~/bundle/vendor/css/colors{% if style == 'material' %}-material{% endif %}") {%- else -%} @Styles.Render("~/bundle/vendor/css/bootstrap{% if style == 'material' %}-material{% endif %}") @Styles.Render("~/bundle/vendor/css/appwork{% if style == 'material' %}-material{% endif %}") @Styles.Render("~/bundle/vendor/css/theme-{{theme}}{% if style == 'material' %}-material{% endif %}") @Styles.Render("~/bundle/vendor/css/colors{% if style == 'material' %}-material{% endif %}") {%- endif %} @Styles.Render("~/bundle/vendor/css/uikit") {% if materialRipple %} @Scripts.Render("~/bundle/vendor/js/material-ripple") {%- endif %} {% if materialRipple and not settingsPanel -%} {% endif %} {% if pageLayout != 'blank' or settingsPanel %} @Scripts.Render("~/bundle/vendor/js/layout-helpers") {%- endif %} {% if settingsPanel %} @Scripts.Render("~/bundle/vendor/js/theme-settings") {% endif %} {% if paceLoader %} @Scripts.Render("~/bundle/vendor/js/pace") {% endif %} {% if pageLayout != 'blank' and pageLayout != 'without-sidenav' %} @Styles.Render("~/bundle/vendor/css/perfect-scrollbar/perfect-scrollbar") {% endif %} @Styles.Render("~/bundle/css/main") @RenderSection("styles", required: false) {% if paceLoader %}
{% endif %} @RenderBody() @Scripts.Render("~/bundle/vendor/js/popper/popper") @Scripts.Render("~/bundle/vendor/js/bootstrap") {%- if pageLayout != 'blank' and pageLayout != 'without-sidenav' %} @Scripts.Render("~/bundle/vendor/js/sidenav") {%- endif %} {% if pageLayout != 'blank' and pageLayout != 'without-sidenav' %} @Scripts.Render("~/bundle/vendor/js/perfect-scrollbar/perfect-scrollbar") {% endif %} @Scripts.Render("~/bundle/js/main") @RenderSection("scripts", required: false)
@{ Layout = "~/Views/Shared/Layouts/_{{layoutClass(pageLayout)}}.cshtml"; }
@{bool hideToggle = ViewData["LayoutNavbarHideToggle"] != null && ViewData["LayoutNavbarHideToggle"].ToString() == "True";}
@Html.ActionLink("Asp.Net MVC Starter", "Index", "Home", null, new { @class = "navbar-brand" })
@if (!hideToggle) {
}
Link 1
Link 2
@{bool isHorizontal = ViewData["LayoutSidenavHorizontal"] != null && ViewData["LayoutSidenavHorizontal"].ToString() == "True";} @{string currentPage = ViewContext.RouteData.Values["Controller"].ToString() + "/" + ViewContext.RouteData.Values["Action"].ToString();}
Home
Page 2
Link 1
Link 2