I would like to take an existing action method, map its return value to a string, and send it as JSON to respond to an AJAX request.
To do this, I need to display an ActionResult for the row. How to do it?
We have the opposite, where we can convert the string to ActionResult using this.Content ().
Refresh
The existing and first action method returns an ActionResult type, but it does return a ViewResult to respond to the HTTP request. I have a second action method (my facade) that returns a JsonResult that responds to AJAX requests. I want this 2nd action method to use the 1st action method to render HTML.
In a grand scheme of things, I want the ActionResult (generated from the action method) to be retrieved not only by a standard HTTP message, but also by an AJAX request through the facade action method (second action method). So, as a developer, I have the choice of using HTTP mail or AJAX to get the page rendered.
Sorry, I tried to make this update as short as possible. Thanks.
json string asp.net-mvc actionresult actionmethod
burnt1ce
source share