How to add script link to _Layout.cshtml with NuGet package?

I have an assistant called "SelectionOtherInput" to capture a meaningful value when the user selects "Other" in the selection list.

I built a NuGet package for it, and it is ready to use, as installed, provided that it has a link to the JavaScript file on the page, or more simply, in _Layout.cshtm file . It’s easy to tell the user: “Install the NuGet package and then add this script link”, but why not tell them: “Copy these files and then add this script link?” and skip NuGet?

I realized that editing a file can be complicated and involves CodeDOM <but these are risks.

The bounty is guaranteed as soon as it is allowed!

+4
source share
1 answer

This is a Unix _Layout.cshtm file

 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")"></script> <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")"></script> </head> <body> <ul id="menu"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("Movies", "Index", "Movies")</li> <li>@Html.ActionLink("About", "About", "Home")</li> </ul> <section id="main"> @RenderBody() <p>Copyright W3schools 2012. All Rights Reserved.</p> </section> </body> </html> 
0
source

All Articles