MikePR
MikePR

Reputation: 2986

Style not working when using Foundation Zurb in MVC in VS 2013

Hope you can help me with the following:

I already created an MVC site in Visual Studio 2013. It runs OK using Bootstrap as expected. NOW, that I want to use the Foundation framework in the site as well, I'm having some problems when trying to execute the site.

Here's what I already did:

  1. I downloaded and installed the Foundation Zurb package using the Nuget package manager
  2. I added some extra files to my project (the foundation folder with its corresponding .css files)
  3. Then I opened the BundleConfig.cs file to bundle the new JS and CSS files.

    //Add the Foundation scripts bundles.Add(new ScriptBundle("~/bundles/foundation").Include( "~/Scripts/foundation/foundation.*", "~/Scripts/foundation/jquery.cookie.js", "~/Scripts/foundation/fastclick.js"));

    //Add the Foundation styles bundles.Add(new StyleBundle("~/Content/foundation").Include( "~/Content/foundation/foundation.css", "~/Content/foundation/foundation.mvc.css", "~/Content/foundation/normalize.css"));

  4. I compiled the solution without any error

  5. Then clicking on the Run button to execute the page in Firefox or Google Chrome

  6. However the html code that used the styles are not working properly. This is the html code:

    profile image John Doe President of XPTO

    [email protected]

    @username

    [email protected]

  7. Followers 432
  8. Following 432
  9. Views 432

Is there something that I' missing?

Thanks in advance

Upvotes: 0

Views: 452

Answers (2)

Ryfcia
Ryfcia

Reputation: 457

It's silly, but in my case the problem was, that bundles registration in Global.asax.cs file was missing in Application_Start() method:

BundleConfig.RegisterBundles( BundleTable.Bundles );

remember to add

using System.Web.Optimization;

Upvotes: 0

aleha_84
aleha_84

Reputation: 8539

3.5 Add new bundles to layout

//razor markup
@Styles.Render("~/Content/foundation")
@Scripts.Render("~/bundles/foundation")

Upvotes: 0

Related Questions