Share via


Controller.Content 方法

定义

重载

Content(String)

使用字符串创建一个内容结果对象。

Content(String, String)

使用字符串和内容类型创建一个内容结果对象。

Content(String, String, Encoding)

使用字符串、内容类型和内容编码创建一个内容结果对象。

Content(String)

使用字符串创建一个内容结果对象。

protected internal System.Web.Mvc.ContentResult Content (string content);
member this.Content : string -> System.Web.Mvc.ContentResult
Protected Friend Function Content (content As String) As ContentResult

参数

content
String

要写入到响应的内容。

返回

内容结果实例。

适用于

Content(String, String)

使用字符串和内容类型创建一个内容结果对象。

protected internal System.Web.Mvc.ContentResult Content (string content, string contentType);
member this.Content : string * string -> System.Web.Mvc.ContentResult
Protected Friend Function Content (content As String, contentType As String) As ContentResult

参数

content
String

要写入到响应的内容。

contentType
String

内容类型(MIME 类型)。

返回

内容结果实例。

适用于

Content(String, String, Encoding)

使用字符串、内容类型和内容编码创建一个内容结果对象。

protected internal virtual System.Web.Mvc.ContentResult Content (string content, string contentType, System.Text.Encoding contentEncoding);
abstract member Content : string * string * System.Text.Encoding -> System.Web.Mvc.ContentResult
override this.Content : string * string * System.Text.Encoding -> System.Web.Mvc.ContentResult
Protected Friend Overridable Function Content (content As String, contentType As String, contentEncoding As Encoding) As ContentResult

参数

content
String

要写入到响应的内容。

contentType
String

内容类型(MIME 类型)。

contentEncoding
Encoding

内容编码。

返回

内容结果实例。

适用于