asp.net - JsonResult or Json: which to use? -


in asp.net mvc 3, more correct use: json() or new jsonresult()? either returns same result. helping solve office debate.

json() extension method returns jsonresult object behind scenes (rather needing call constructor directly).

i use extension method myself. keeps more in line other common return types action methods view(), partialview(), etc.

i make sure create extension method custom actionresult types create. in end it's matter of personal preference.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -