There are several main ways to return in an MVC controller:
1. Content ():
Returns the text type of contentresult, such as "This is an MVC I do".
2. File ():
Returns the contents of a file type Fileresult, such as PDF
3, Httpnotfound ():
Returns the Httpnotfoundresult that contains the 404HTTP status code.
4. JavaScript ():
Returns a javascriptresult containing JavaScript content, such as "function Hello () {alert (hello,world);}".
5. Json ():
Returns the jsonresult of data in JSON format, such as "{" Messge ": hello,world!}".
6, Partialview ()
Returns a Partialviewresult that contains the contents of a partial view (for example, the view may not contain an ending).
7, Redirect ()
Returns a Redirectresult that contains a 302 jump status value and jumps to the given URL. For example, "302http://www.ebuy.com/auctions/recent". This method contains a sibling method Redirectpermanent (), which also returns Redirectresult, but uses a 301 status code to indicate a permanent jump address instead of a temporary address.
8, Redirecttoaction () and Redirecttoroute ()
Similar to redirect (), only space can dynamically query the routing engine to determine external URLs. As with redirect (), they also include a permanent Jump method: Redirecttoactionrermanent () and Redirecttoroutepermanent ().
9. View ()
Returns the Viewresult of the rendered view.
Results returned by action methods in the MVC controller