Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8826541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:09:45+00:00 2026-06-14T07:09:45+00:00

I realise this breaks the MVC pattern, but there is a viable reason for

  • 0

I realise this breaks the MVC pattern, but there is a viable reason for doing it this way in an application I am currently building 🙂

What I am trying to do is output a JavaScript bundle directly from the Controller rather than via a link via a View.

So for example I have a bundle called “~/jQueryPlugin” what I’d like to do is something along the lines of

return this.JavaScript(BundleTable.GetBundle("~jQueryPlugin").BundleContent)"

However for the life of me I cannot figure out what the BundleTable.GetBundle("~jQueryPlugin").BundleContent part should be in order to get a string representation of the combined minimized bundle.

Any help would be appreciated·

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:09:46+00:00Added an answer on June 14, 2026 at 7:09 am

    In the 1.1-alpha1 release we added a new Optimizer class which should allow you to more easily do this. Its intended to be a standalone class that’s useable out of side of ASP.NET hosting, so setting it up will be slightly different.

    You can get the bundle contents out via something like this:

            OptimizationSettings config = new OptimizationSettings() {
                ApplicationPath = "<your physical path to the app>",
                BundleSetupMethod = (bundles) => {
                    bundles.Add(new ScriptBundle("~/bundles/js").Include("~/scripts/jqueryPlugin.js"));
                }
            };
    
            BundleResponse response = Optimizer.BuildBundle("~/bundles/js", config);
            Assert.IsNotNull(response);
            Assert.AreEqual("<your bundle js contents>", response.Content);
            Assert.AreEqual(JsMinify.JsContentType, response.ContentType);
    

    The next release should be fleshing this scenario out more, as it is needed for build time bundling integration with Visual Studio.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a bit of a vague question I realise, but I've been looking
I have been working on this tidy-up-messy-html tags with DOM, but now I realise
I'm trying to create this simple game but I'm having trouble. Here's the code,
I realise this might be hard to explain, so let me start by using
So Heroku has been down all day, of course I didn't realise this until
Its when I try to do stuff like this I realise I really need
This question may seem blindingly obvious and I realise I am putting myself up
I stumbled upon this problem and it took my a while to realise what
I realize this is syntactically bad but I figure it somewhat explains what I'm
I realize this is more of a hardware question, but this is also very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.