Controller.Content 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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
内容编码。
返回
内容结果实例。