Area Registration Setting of Module
AreaRegistration.cs class is used for area registration and this class is auto generated on the creation of new Area. Every area have its own registration class start with its area name. For example if Area Name is VAT, then registration class name is VATAreaRegistration.cs.
Open AreaRegistration.cs class from Area Folder. In our case this file is VATAreaRegsitration.cs, Do following steps in override function RegisterArea
Add Style Bundle for include all css files.
Initialize Style bundle bygiving full path of Contents folderwhich contain css files and to include css files use unique Style bundle name (e.g. VATStyle) at the end of the path. Normally used module prefix name + ‘Style’.
Example:
StyleBundle style = new StyleBundle("~/Areas/VAT/Contents/VATStyle");
Code to include all css files in style bundle......
see example below....
style.Include("~/Areas/VAT/Contents/vat.css");
Add java script Bundle for include all .js files.
Initialize Script bundle by giving full path of Scripts folder which contain js files and to include js files use unique script bundle name (e.g. VATJs) at the end of the path. Normally used module prefix name + ‘Js’.
Example:
ScriptBundle script = new ScriptBundle("~/Areas/VAT/Scripts/VATJs");
Code to include all js files in script bundle......see example below....
script.Include("~/Areas/VAT/Scripts/callouts.js",
"~/Areas/VAT/Scripts/app/forms/employeeformbydialog.js",
"~/Areas/VAT/Scripts/app/forms/employeeformbyview.js",
"~/Areas/VAT/Scripts/app/forms/employeeformbyjavascript.js");
Register Script and Style into VAdvantage Framwork.
ModuleBundle class is used for handle script and style registration into VAdvantage Framwork.
ModuleBundle registration provides you three parameters
BundleType (Object of Style or Script).
MPC (Module Prefix Code).
3.Order (Loading order of bundle. It must be greater than zero and dependent module order must be greater on which module it depend)
Code for script registration
VAdvantage.ModuleBundles.RegisterScriptBundle(script, "VAT", 10);
Code for Style registration
VAdvantage.ModuleBundles.RegisterStyleBundle(style, "VAT", 10);
As shown code below.