3

Simple question - am current having a test of MVC4 and noticed I can use the Json.Encode method in any of the views (not the Json method in the controller).

The namespace (System.Web.Helpers) is in the web.config as it should be and simply referencing the object directly doesn't work.

The reference is in the references list in the project, however looking into the library the Json object is not there either.

I have tried adding the System.web.helpers library again, which adds the Json object however am unable to access it.

Any help would be much appreciated

5
  • No I didn't manage to, I went into the nuget package manager (right click on the project) and made sure the project had JSON.net (I think it already came with it) and just used this - not the same I know but what can ya do?! Commented Nov 21, 2012 at 22:00
  • 1
    Check out stackoverflow.com/a/13541258/973485 Commented Nov 29, 2012 at 17:39
  • I don't understand his answer, "Add references under" ? Assemblies > Framework? and there is no system.web.helpers assembly, maybe because the references window is being filtered on .net 4? Commented Nov 30, 2012 at 0:03
  • I've added a image step guide now, maybe that will help. Commented Nov 30, 2012 at 0:18
  • This is in VS2012? I am in 2010 still.. Commented Nov 30, 2012 at 2:30

0

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.