3
//My BundleConfig.cs look like-
public class BundleConfig
{        
    public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                    "~/Scripts/jquery.validate*",
                    "~/Scripts/jquery.unobtrusive*"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryUI").Include(
                  "~/Scripts/jquery-ui.js",
                  "~/Scripts/CustomAutocomplete.js"));

        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                "~/Scripts/modernizr-*"));

        bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                  "~/Scripts/bootstrap.js",
                  "~/Scripts/respond.js",
                  "~/Scripts/bootstrap-datetimepicker.js"));


        bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/bootstrap.css",
                  "~/Content/bootstrap-datetimepicker.css",
                  "~/Content/site.css",
                  "~/Content/JqueryUI/jquery-ui.css"));            
    }
}

//In cshtml file calls like-

@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/jqueryval")

While running project in visual studio it works fine but after deploying on server some css and js files are not loads correctly I have also done IIS settings as explained here
after deploy webpage looks like after deploy webpage looks like

But webpage should look like this But webpage should look like this

Please provide solution...

Community
  • 1
  • 1
Mahadev
  • 103
  • 10

1 Answers1

0

I think you problem in your IIS setting.If you use Windows PC go

Control Panel>All Control Panel Items>Programs and Features

then in left side click Turn Windows Features on or off.

after then go Internet Information Services>World wide web service>Common HTTP Features and checked Static Content and click ok for apply changes.

after this change successfully restart you PC.

If you use Windows server setting all most same.

As per Update your Question

After publishing you miss some CSS.You can fiend which you missing by inspect element in your browser.and add them into correct location.

cause: when you add the file some how then file properties (Build Action not set into content)

solution : So fiend which files you missing and go to visual studio and right click on those file and go to properties and set Build Action=content.

Hopefully it's help for you.

Ashiquzzaman
  • 5,129
  • 3
  • 27
  • 38