I have this call in my master page:
$.ajax({
type: "POST",
url: "<%= Url.Action("CreateTermSheet", "Indications") %>",
data: GetJSONForID(),
success: function(data) {
alert('Success!');
}
});
But when I go to load the page it doesn’t render and I get this compilation error:
CS0103: The name ‘Url’ does not exist in the current context
What’s wrong? I do this other places in my app completely fine.
This error means here that your views did not reference
System.Web.Mvc. It should be automatically added by Visual Studio. Check the reference in your Views Web.config (Project Directory/Views/Web.config) in<system.web>/<pages>