I am new to MVC, as I try to learn (while doing things in the most professional way), I am staring with Empty MVC4
template.
Speaking not only for my self I assume:
could anyone be real kind to walk through the implementation from ground zero, step by step?
So now, that I remembered reading somewhere about the technique of declaring a folder for the scripts instead of specifying each, I had to implement it my self, meaning I estimate every new thing (it's pros and cons) then I decide if I am using it, that is why I start an Empty project.
So I start to learn how to implement it correctly, and I read about the order issue and I read some more scattered information but I could not see clear instructions on where and when to put it all and which one of the examples of implementation should I use:
First where do I create this? (just place it within a .Cs file within App_Start
?
//so only cause it's there it will be invoked ? (...same as windows Run ?)
public static 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.unobtrusive*",
"~/Scripts/jquery.validate*"));
}
}
In the code above Add new sb(" --> ~/bundles < -
is it a variable or physical folder
Do I need to implement the {version}
parameter/variable
And last, what is the correct or top notch approach for ordering?
Where in relation to the project and to each other (bundle vs ordering) it is placed?
I have mentioned the issue of ordering so I could better understand so I could properly implement the code, I have tried to understand from such answers as @Kayees pointed out, but It's not talking on some important steps as to where to place the code within solution and as @LoneXcoder pointed out Bundle-ordering