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

tereško
  • 58,060
  • 25
  • 98
  • 150
m.t.bennett
  • 1,290
  • 16
  • 34
  • 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?! – m.t.bennett Nov 21 '12 at 22:00
  • 1
    Check out http://stackoverflow.com/a/13541258/973485 – BjarkeCK Nov 29 '12 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? – m.t.bennett Nov 30 '12 at 00:03
  • I've added a image step guide now, maybe that will help. – BjarkeCK Nov 30 '12 at 00:18
  • This is in VS2012? I am in 2010 still.. – m.t.bennett Nov 30 '12 at 02:30

0 Answers0