XdmWriterSettings.MediaType PropertyXdmWriterSettings.MediaType PropertyXdmWriterSettings::MediaType Property

Gets or sets a string specifying the media type (MIME content type) of the output.

Syntax

Public Property MediaType As String
        Get
        Set(ByVal value As String)
public string MediaType { get; set; }
public:
property String^ MediaType {
    String^ get();
    void set(String^ value);
}
 

Property Value

Type: System.StringSystem.StringSystem::String^

The media type of the output.

Exceptions

ExceptionCondition
XdmExceptionXdmExceptionXdmException An SEPM0016 error is raised if an invalid media-type setting is attempted.

Remarks

This property corresponds to the media-type serialization parameter.

The value of this property is used in the generated content-type declaration if the IncludeContentTypeIncludeContentTypeIncludeContentType is set to trueTruetrue and MethodMethodMethod is HtmlOutputMethodHtmlOutputMethodHtmlOutputMethod or XHtmlOutputMethodXHtmlOutputMethodXHtmlOutputMethod. It may also be used to annotate the serialized data, for example in an HTTP request.

The charset parameter of the media type must not be specified explicitly in the value of the of MediaTypeMediaTypeMediaType, instead it should be set via the EncodingEncodingEncoding property.

If the value of this property is null a null reference (Nothing in Visual Basic) nullptr then the default media type as defined by DefaultMediaTypeDefaultMediaTypeDefaultMediaType for the current output method is used.

The default value of this property is null a null reference (Nothing in Visual Basic) nullptr.