I think I will justify JSON output in the controller, since JSON is just a form of ViewData, similar to how to use the ViewData dictionary to link to View pages.
And the actual browse page is already displayed or processed by client-side languages. Although one drawback is that the JSON-output controller is completely dependent on the view, yes, you can still change the view to another thing that accepts this JSON as a communication channel, but it is not a good idea if you want to change the client, for example, a desktop application using other channels as a connection (for example, a direct TCP connection or SOAP application, etc.), because the controller is designed for JSON. (True, you can make an adapter for translation).
Thus, to complete it, the JSON rendering in the controller is fine until you plan to use a different platform, showing that the controller has not changed.
source share