ControllerBase.Content Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Überlädt
Content(String) |
Erstellt ein Objekt, indem eine ContentResult |
Content(String, MediaTypeHeaderValue) |
Erstellt ein Objekt, indem eine ContentResult Zeichenfolge und eine |
Content(String, String) |
Erstellt ein Objekt, indem eine ContentResult Zeichenfolge und ein |
Content(String, String, Encoding) |
Erstellt ein Objekt, indem eine Zeichenfolge, |
Content(String)
Erstellt ein Objekt, indem eine ContentResultcontent
Zeichenfolge angegeben wird.
public:
virtual Microsoft::AspNetCore::Mvc::ContentResult ^ Content(System::String ^ content);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Content : string -> Microsoft.AspNetCore.Mvc.ContentResult
override this.Content : string -> Microsoft.AspNetCore.Mvc.ContentResult
Public Overridable Function Content (content As String) As ContentResult
Parameter
- content
- String
Der Inhalt, der in die Antwort geschrieben werden soll.
Gibt zurück
Das erstellte ContentResult Objekt für die Antwort.
- Attribute
Gilt für
Content(String, MediaTypeHeaderValue)
Erstellt ein Objekt, indem eine ContentResult Zeichenfolge und eine contentType
content
Zeichenfolge angegeben wird.
public:
virtual Microsoft::AspNetCore::Mvc::ContentResult ^ Content(System::String ^ content, Microsoft::Net::Http::Headers::MediaTypeHeaderValue ^ contentType);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content, Microsoft.Net.Http.Headers.MediaTypeHeaderValue contentType);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content, Microsoft.Net.Http.Headers.MediaTypeHeaderValue? contentType);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Content : string * Microsoft.Net.Http.Headers.MediaTypeHeaderValue -> Microsoft.AspNetCore.Mvc.ContentResult
override this.Content : string * Microsoft.Net.Http.Headers.MediaTypeHeaderValue -> Microsoft.AspNetCore.Mvc.ContentResult
Public Overridable Function Content (content As String, contentType As MediaTypeHeaderValue) As ContentResult
Parameter
- content
- String
Der Inhalt, der in die Antwort geschrieben werden soll.
- contentType
- MediaTypeHeaderValue
Der Inhaltstyp (MIME-Typ).
Gibt zurück
Das erstellte ContentResult Objekt für die Antwort.
- Attribute
Gilt für
Content(String, String)
Erstellt ein Objekt, indem eine ContentResult Zeichenfolge und ein content
Inhaltstyp angegeben werden.
public:
virtual Microsoft::AspNetCore::Mvc::ContentResult ^ Content(System::String ^ content, System::String ^ contentType);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content, string contentType);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Content : string * string -> Microsoft.AspNetCore.Mvc.ContentResult
override this.Content : string * string -> Microsoft.AspNetCore.Mvc.ContentResult
Public Overridable Function Content (content As String, contentType As String) As ContentResult
Parameter
- content
- String
Der Inhalt, der in die Antwort geschrieben werden soll.
- contentType
- String
Der Inhaltstyp (MIME-Typ).
Gibt zurück
Das erstellte ContentResult Objekt für die Antwort.
- Attribute
Gilt für
Content(String, String, Encoding)
Erstellt ein Objekt, indem eine Zeichenfolge, contentType
eine ContentResult und contentEncoding
eine content
angegeben wird.
public:
virtual Microsoft::AspNetCore::Mvc::ContentResult ^ Content(System::String ^ content, System::String ^ contentType, System::Text::Encoding ^ contentEncoding);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content, string contentType, System.Text.Encoding contentEncoding);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Content : string * string * System.Text.Encoding -> Microsoft.AspNetCore.Mvc.ContentResult
override this.Content : string * string * System.Text.Encoding -> Microsoft.AspNetCore.Mvc.ContentResult
Public Overridable Function Content (content As String, contentType As String, contentEncoding As Encoding) As ContentResult
Parameter
- content
- String
Der Inhalt, der in die Antwort geschrieben werden soll.
- contentType
- String
Der Inhaltstyp (MIME-Typ).
- contentEncoding
- Encoding
Die Inhaltscodierung.
Gibt zurück
Das erstellte ContentResult Objekt für die Antwort.
- Attribute
Hinweise
Wenn die Codierung sowohl vom "Charset" als contentEncoding
auch den Parametern bereitgestellt wird, wird der contentEncoding
Parameter als endgültige Codierung ausgewählt.