I'm starting a new project with asp.net mvc4 internet application.
First thing I did was install a package called Twitter Bootstrap for Asp.Net MVC 4 Sample via nuGet.
This installed other two packages Bootstrap and Twitter Bootstrap for Asp.Net MVC 4.
When I run the application,I get this
I didn't face this problem in previous projects. When I installed twitter bootstrap, things were fine when i built the application.
Can anyone explain or suggest, what might be going wrong?
Edit 1:
I have another project where bootstrap works fine. When I run the two projects in chrome and check the network, file that are loaded for both the projects are same.
There is a file BundleConfig.cs (or a specific BootstrapBundleConfig.cs) in your "App_start" folder of your MVC4 project.
It will have a declaration of something like this:
// It won't look exactly like this..
bundles.Add(new StyleBundle("~/Content/bootstrap/css/style").Include(
"~/Content/bootstrap/css/bootstrap.css",
"~/Content/bootstrap/css/bootstrap-theme.css"
));
Now you must go to your "Views/Shared/_Layout.cshtml" file (or whatever you base layout is) and add the following line within your head section.
<head>
/// Other stuff in here
// This renders the boostrap style
#Styles.Render("~/Content/bootstrap/css/style")
// include any overrides to bootstrap you have after the library
</head>
Related
So I recently update from bootstrap 2 to bootstrap 4. I then changed the syntax, grids and such. The website was running/building fine in debug, however, when it comes to release, it won't work. It can build without errors, but when I run it, it seems like the site has the new syntax and classes (the code running is the one i changed) but bootstrap is still at v.2. I checked multiple times, there are no bootstrap 2 files left, nor any cdn references. I can see it still is running bootstrap 2 by changing classes from col-12 to, say span12. It works fine in debug, but not in release. Any clue why ?
Also, the site is running Asp.NET Core MVC Razor.
I think you might have a bundle-ing configuration issue.
Please verify your bundle configuration (App_Start\BundleConfig.cs) and the web.config settings and pertinent web.config transform.
You can find documentation on how to configure your bundles here : Bundling and Minification (assuming you're not using ASP.NET Core)
For ASP.NET Core it a bit more complicated because you can have multiple ways of doing the budleing. Documentation for it can be found here: Bundle and minifiy static assets in ASP.NET Core.
However, I think that is pretty probable that the production version of your app is still targeting the old Bootstrap version because of the bundle-ing configuration
I googled this until my eyes bled. I can't find what's causing it to save my life.
I'm using MVC4 with KendoUI HTML5 Framework; one of the 2015 editions. Everything's .min so I can't find the exact version.
On development, Kendo UI icons show fine.
On a VM I created to test deployments, Kendo UI icons show fine.
On the customer's network in production, Kendo UI icons do not show.
On the customer's network, you can navigate to the location of the icon sprite file successfully (no 404 error)
Bootstrap icons show normally in all cases. It's only the Kendo UI icons.
Dev means there's no inherent problem with the icons or CSS. The VM deployment working fine means it is most likely not an MVC bundling problem--I'm using the following solution for the bundling issue.
.Include("~/Content/kendo/kendo.bootstrap.min.css", new CssRewriteUrlTransform())
I have absolutely no idea what is different on my customer's network that causes KendoUI icons not to display. I'm baffled, and--as always--unbelievably grateful for any help you all can give.
For a start, you can disable bundling on production, to see if it is related to the problem.
On the other hand, with bundling enabled, there should be some 404 error in the browser console when the sprite file doesn't load - I suggest checkng what the request URL is in that case, and compare it with the working URL when you access the sprite file directly.
Also check this thread that may be applicable:
CssRewriteUrlTransform with or without virtual directory
In my case the icons were not copied over to production. I copied the kendo sub folder from contents folder to the corresponding folder in production and that solved it. Visual Studio 2010 MVC 3. No bundling used.
This should work and I have no clue why it doesn't, literally all I am doing is creating a new ASP.NET MVC Web application in VS15 Community, and then I replace the existing min.css file with another one (from bootswatch). And it doesn't change anything.
I have practiced mvc for a bit and every time I tried to change my layout later on in the project, it worked every time, but now as I just decided to get it out of the way straight up it just doesn't do anything.
You'll want to change the non-minified version as well.
Edit: Because the minified version is used when you publish and the non-minified version is used during debug, generally.
My team and I are currently developing an application for both Android and iOS using ASP.NET MVC 4, HTML5, and PhoneGap. The development works perfectly fine; however, one question remains unanswered: What is the recommended approach to generate the three files PhoneGap needs (one HTML page, one JavaScript file, and one CSS stylesheet) from our MVC solution?
Would you recommend using a Razor template-based approach? Or would you simply automatically copy the output HTML source after each build? Or would you suggest something completely else?
This morning, we decided to let ASP.NET MVC render a single view containing all our application's HTML which references several JavaScript files and CSS stylesheets. We then automatically grab the rendered HTML source and copy an index.html into a certain export folder on our local machine. That folder is ready to be deployed because it contains only one HTML file and additional JavaScript and CSS resources – exactly what PhoneGap expects.
I'm using nuget to load jQuery and jQuery Mobile packages into my project. Nuget is loading jquery.mobile-1.0.1.min.css and jquery.mobile.structure-1.0.1.min.css. Which should I use? Both? What are the differences?
The primary difference is that the jquery.mobile.structure-1.0.1.min.css provides basic css styling while the jquery.mobile-1.0.1.min.css is the structure plus default theme swatches.
If you are using your own custom theme (maybe from themeroller) then you should be fine with just the structure file. Check out this page for more information on different download configurations.