Site icon Dotnet Helpers

Adding Javascript and css file in MVC

Adding Javascript and css file in MVC

Here let we saw how to add .js and css file in mvc

Step 1 : Add Script (.js)/(.css) file under the script folder

Step 2 : Include the file in the BundleConfig.cs under App_Start folder as show below

Step 3 : Finally include the bundle in the view (ie., .cshtml)

@Scripts.Render(“~/bundles/slider”)
@Styles.Render(“~/Content/css”)

Exit mobile version