Implementing the original bundle collection in MVC5

My MVC5 website has a designated area called Freemium where I am encountering an issue with loading jquery and css files. While the bundles collection works smoothly for the rest of my website, it fails to load these essential files in the freemium area. After investigating the problem, I discovered that copying all the css and jquery files into the area folder solves the issue temporarily. However, I am reluctant to continue this manual process as it involves repetitive copy & paste actions.

When attempting to render the css and js using

@Styles.Render("~/Freemium/Content/metro-ui/css") 

I encounter the following error:

The controller for path '/Freemium/Content/metro-ui/css' was not found or does not implement IController. Stack trace: at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)**

Here are the bundle configurations that need to be functioning properly in the freemium area:

private static BundleCollection SetMetroUIFreemiumBundles(BundleCollection bundles)
    {
        // CSS
        bundles.Add(new StyleBundle("~/Freemium/Content/metro-ui/css/metrocss")
            .Include("~/Content/metro-ui/css/metro-bootstrap.css"
            , "~/Content/metro-ui/css/metro-bootstrap-responsive.css"
            , "~/Content/metro-ui/css/iconFont.min.css"));

        // Scripts
        bundles.Add(new ScriptBundle("~/Freemium/Scripts/metro-ui/metrojs")
            .Include("~/Scripts/metro-ui/jquery.ui.widget.js"
            , "~/Scripts/metro-ui/metro.min.js"));

        return bundles;
    }

Answer №1

It has been some time since I last worked on an MVC website, but shouldn't it look like this?

@Styles.Render("~/Freemium/Content/metro-ui/css/metrocss")

The Render("path") should correspond to the new StyleBundle("path").

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Steps to Activate a Hyperlink for Opening a Modal Dialogue Box and Allowing it to Open in a New Tab Simultaneously

I am currently working on a website project. Within the website, there is a hyperlink labeled "View Page". The intention is for this link to open the linked page in a modal dialog upon being clicked. Below is the code snippet that I have used to achieve t ...

Troubleshooting: Issues with jQuery animate() not functioning properly when adjusting CSS

Currently, I am experimenting with jQuery's .animate() function to change the background of a div when it is scrolled more than 100 pixels down a page. Previously, I had successfully used .css() for this purpose. JS: $(window).scroll(function () { ...

sending a symfony2 form through ajax for processing

Using Symfony2, doctrine2, and twig. Attempting to submit a form using Ajax but always receiving the message: "This is not ajax!". Can't seem to find the issue. Any help would be appreciated. Twig code: <form id="form_newsletter" action="{{ path ...

Crafting a Custom SelectionChangedEventHandler in C# for Your Project

I am currently working in a Silverlight project where I have encountered a unique situation that requires me to implement my own SelectionChangedEventHandler handler function. The reason for this unusual requirement is as follows: The scenario I am facing ...

Guide to implementing a button click event with a callback function in JavaScript similar to the window.confirm functionality

Welcome to Stackoverflow, I am a newbie here and seeking some guidance. My question revolves around creating a custom popup message akin to window.confirm. The function requires the user to input arguments such as message header, content, message type, and ...

Tips for lining up items in a row

I am struggling to align these boxes next to each other instead of on top of each other. It seems like it should be an easy task, but I just can't seem to make it work. Check out my code here for reference. <body> <div class="horAlign"&g ...

Selected Multiple Options - Deselect the "All" choice when selecting any other option, and vice versa

I'm using the Chosen Multiple Select plugin that includes an "All" option. For reference, you can visit this link. The functionality I am aiming for is as follows: If a user selects any option other than "All", I want to automatically deselect " ...

A guide to using select2.js to activate a selection based on a data attribute

I'm faced with the following html snippet: <div class='multiWrapper'> <select id="multi" class="js-dropdown-from-code"> <optgroup class='def-cursor' label='Code' data-city ...

Choose the number that is nearest to the options given in the list

I am faced with a challenge involving a list of numbers and an input form where users can enter any number, which I want to automatically convert to the closest number from my list. My list includes random numbers such as 1, 5, 10, 12, 19, 23, 100, 400, 9 ...

Retrieve elements using jquery and selenium IDE version 1.0.8

Can anyone help me with finding elements using JQuery and Selenium IDE 1.0.8? <td>storeValue</td> <td>$('#result').find('img').filter('[alt=&quot;NameOfPhoto&quot;]').eq(0)</td> <td></ ...

Displaying images in Xamarin from local files or resources

Having trouble displaying images on Android using Xamarin. I have tried ImageSource.FromFile and ImageSource.FromResource methods. I've gone through the "Working with Images" guide multiple times but still can't figure out what I'm missing. ...

Notifications were successfully sent to iOS devices using PushSharp, however, they were not received

I have been utilizing the most recent version of PushSharp (4.0.10) to push notifications to both iOS and Android devices. I had previously tested this functionality around 9 months ago and everything was working smoothly. However, when I tried running t ...

Send an array of object numbers to the event processor

My task involves working with an array of PictureBoxes. for(int i = 0; i<10; i++) { this.elevatorDoors[i] = new System.Windows.Forms.PictureBox(); } The challenge I'm facing is passing the array number of each object to its respective click e ...

Function that is triggered by scrollbar height indicator

I'm currently utilizing jQuery to retrieve the user's current height and triggering an animation function once they reach that height (similar to reactive websites where animations occur as the user scrolls down the page). However, I am struggli ...

Expanding the borders of a div while hovering using bootstrap styling

Looking to add a hover border around only the edges of a div? Check out this grid layout I created using bootstrap. You can view the code on my CodePen. <div class="product-grid col-md-4"> <a class="preview" href="#">PREVIEW</a> </d ...

Collaborate with content enhanced by the combination of Scrolloverflow.js and Fullpage.js for a

I have incorporated Fullpage.js along with the Scrolloverflow plugin in my template: $('#fullpage').fullpage({ scrollOverflow: true, afterRender: function() { $("nav").on("click", "a", function() { ... } } ...

Searching for elements using jQuery's "attribute-based" selector

Check out this straightforward example on jsfiddle: HTML: <input type="text"/> <input type="text" value="aaa"/> JS: $("input:first").val("aaa"); alert($("input[value='aaa']").length);​ Have you ever wondered why Chrome and IE g ...

Navigating a jQuery collection using iteration

My goal is to loop through an array and set values to an element in the following manner: <tool>hammer</tool> var tools = ["screwdriver", "wrench", "saw"]; var i; for (i=0; i < tools.length; ++i){ $("tool").delay(300).fadeOut().delay(100). ...

jquery does not reset trigger for menu navigation

At the moment, I am using a script that enables a button to toggle a menu open and closed, while also changing its class to create a simple animation effect depending on whether it's open or closed. It's a straightforward yet effective method. $ ...

Positioning an image absolutely to the right of a select element with a dynamic width

I am facing a challenge with styling a dynamic width select dropdown. I am trying to add some space between this dropdown and an image positioned to the right, but CSS has not been proving effective so far. Explore my code on jsfiddle: http://jsfiddle.net ...