ActionResult 類型

1 篇文章 / 0 new
author
ActionResult 類型
相關類別
用途

The following table shows the built-in action result types and the action helper methods that return them.

Action Result

Helper Method

Description

ViewResult

View

Renders a view as a Web page.
Represents HTML and markup rendered by a view

PartialViewResult

PartialView

Renders a partial view, which defines a section of a view that can be rendered inside another view.
Represents HTML and markup rendered by a partial view

RedirectResult

Redirect

Redirects to another action method by using its URL.

RedirectToRouteResult

RedirectToAction

RedirectToRoute

Redirects to another action method.
Represents a result that performs a redirection by using the specified route values dictionary

ContentResult

Content

Returns a user-defined content type.
Represents a text result

JsonResult

Json

Returns a serialized JSON object.
Represents a JavaScript Object Notation result that can be used in an AJAX application

JavaScriptResult

JavaScript

Returns a script that can be executed on the client.
Represents a JavaScript script

FileResult

File

Returns binary output to write to the response.
•FileContentResult – Represents a downloadable file (with the binary content).
•FilePathResult – Represents a downloadable file (with a path).
•FileStreamResult – Represents a downloadable file (with a file stream).

EmptyResult

(None)

Represents a return value that is used if the action method must return a null result (void).


from
http://weblogs.asp.net/rajbk/archive/2010/05/03/actionresult-types-in-mv...
http://msdn.microsoft.com/en-us/library/dd410269.aspx
關鍵字: 
Free Web Hosting