Reputation: 22926
I have the following line of code in an asp.net page:
$("#example").editable('<%=Url.Action("UpdateSettings","Admin") %>');
In document.read (javascript), but visual studio throwns an error when I try to compile it:
Error 2 The name 'Url' does not exist in the current context
Any ideas why this would happen?
Upvotes: 0
Views: 2851
Reputation: 861
What version of MVC are you using? Are yo using web forms or razor views?
Razor Syntax
$("#example").editable('@Url.Action("UpdateSettings","Admin")');
Upvotes: 1
Reputation: 2120
Appranetly identical error over at asp.net forums. Do you have system.web.mvc referenced in your app?
Upvotes: 1