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
Post a Comment