Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
1.60/5 (2 votes)
i created simple view and add css and js into it. it working , but when i add css and js into layout page its not working.

What I have tried:

In _Layout page

<!DOCTYPE html>





@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/Scripts/jquery-1.10.2.js")


@Scripts.Render("~/Content/Metronic/global/plugins/jquery.min.js")
@Scripts.Render("~/Content/Metronic/global/plugins/bootstrap/js/bootstrap.min.js")
@Scripts.Render("~/Content/Metronic/global/plugins/js.cookie.min.js")
@Scripts.Render("~/Content/Metronic/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js")
@Scripts.Render("~/Content/Metronic/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js")
@Scripts.Render("~/Content/Metronic/global/plugins/jquery.blockui.min.js")
@Scripts.Render("~/Content/Metronic/global/plugins/uniform/jquery.uniform.min.js")
@Scripts.Render("~/Content/Metronic/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js")



@Scripts.Render("~/Content/Metronic/global/scripts/app.min.js")

@Scripts.Render("~/Content/Metronic/layouts/layout/scripts/layout.min.js")
@Scripts.Render("~/Content/Metronic/layouts/layout/scripts/demo.min.js")
@Scripts.Render("~/Content/Metronic/layouts/global/scripts/quick-sidebar.min.js")
Posted
Updated 26-Oct-16 1:46am
Comments
Karthik_Mahalingam 30-Sep-16 1:37am    
remove this line and check
@Scripts.Render("~/Content/Metronic/global/plugins/jquery.min.js")
Ehsan Sajjad 30-Sep-16 7:24am    
you are adding jquery multiple times, please avoid that, that is most probably the reason for it

You cannot have multiple jquery library files added on the page, which is happening right now, so you need to exclude one of the file which are right now there i.e:

C#
@Scripts.Render("~/Scripts/jquery-1.10.2.js")


@Scripts.Render("~/Content/Metronic/global/plugins/jquery.min.js")


Remove one of these and it should be good to go.
 
Share this answer
 
Comments
T_Sub 3-Oct-16 0:42am    
ok i have used both js such as default and own js , so i think it can be a issue. thank you very much,

in my layout.

@Scripts.Render("~/Scripts/jquery-1.10.2.js")
@Scripts.Render("~/Content/Metro/global/plugins/jquery.min.js")
Use own master page will best way.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900