0

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?

1
  • Are you using ASP. NET MVC 2 ? Commented Dec 17, 2011 at 10:35

2 Answers 2

1

What version of MVC are you using? Are yo using web forms or razor views?

Razor Syntax

$("#example").editable('@Url.Action("UpdateSettings","Admin")');
Sign up to request clarification or add additional context in comments.

Comments

1

Appranetly identical error over at asp.net forums. Do you have system.web.mvc referenced in your app?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.