I've seen a lot of examples using Url.Content to reference javascript, form MasterPages in MVC 2.
<script src="<%: Url.Content("~/Scripts/jquery-1.4.1.min.js") %>" type="text/javascript"></script>
But on runtime I've got failure,
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'Url' does not exist in the current context.
I haven't find where Url namespace is declared, should additional assemblies be using?
VS2010, IIS 7, ASP.net MVC 2.0
Make sure your master page inherits System.Web.Mvc.ViewMasterPage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With