---
title: "What is CSS Bundles with Controller Route Source"  
description: "What is CSS Bundles with Controller Route Source"  
author: "Anonymous User"  
published: 2014-11-14  
updated: 2014-11-15  
canonical: https://www.mindstick.com/forum/12590/what-is-css-bundles-with-controller-route-source  
category: "asp.net"  
tags: ["c#", "asp.net mvc", "mvc5"]  
reading_time: 1 minute  

---

# What is CSS Bundles with Controller Route Source

I created a [controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc) path to return a css file, which works, and returns Response.ContentType = "text/css".

**Now I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to put that URL in my [bundles](https://www.mindstick.com/forum/33890/examples-of-intent-and-bundles) file, like this:**

```
bundles.Add(new StyleBundle("~/Content/custom").Include(  "~/CSS/Custom/1"));
```

NOTE: /CSS/[Custom](https://www.mindstick.com/blog/12298/use-custom-writing-services-to-get-through-the-finals)/1 is a [route](https://www.mindstick.com/interview/396/what-is-routed-event-in-wpf) that returns a text/css file.

**In my view I have:**

@[Styles.Render](https://www.mindstick.com/forum/518/styles-render)("~/[Content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand)/custom")

When I build the [project](https://www.mindstick.com/articles/105927/how-to-excel-at-managing-multiple-projects), the bundler returns this in my HTML:

<link href="/Content/custom?v=" rel="stylesheet"/>

When I view the [files](https://www.mindstick.com/articles/23302/the-importance-and-advantage-of-keeping-your-important-files-on-the-cloud) [source](https://www.mindstick.com/interview/840/what-happens-if-the-both-source-and-destination-are-named-same), It's empty.

How do I get this to work?

## Replies

### Reply by Norman Reedus

Not sure why you'd want to do this

After taking a look at it in reflector, during the bundling process it will take the virtual path to the item and check to make sure the file exists. (Code below) So bundling without CDN absolutely requires a file, not an application route.

```
if ((this.VirtualPathProvider == null) || this.VirtualPathProvider.FileExists(virtualPath)){    base.Add(new BundleItem(virtualPath, transforms));}
```

CDNs never hit this line, they take a different path.

```
bundles.UseCdn = true;bundles.Add(new StyleBundle("~/Content/custom", "/CSS/Custom/1"));BundleTable.EnableOptimizations = true;
```


---

Original Source: https://www.mindstick.com/forum/12590/what-is-css-bundles-with-controller-route-source

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
