編輯

共用方式為


SyndicationLink.RelationshipType Property

Definition

Gets or sets the relationship type of the linked resource.

public:
 property System::String ^ RelationshipType { System::String ^ get(); void set(System::String ^ value); };
public string RelationshipType { get; set; }
member this.RelationshipType : string with get, set
Public Property RelationshipType As String

Property Value

The relationship type of the linked resource.

Examples

The following code shows how to set the relationship type of a syndication link.

The following XML shows how the RelationshipType property is serialized to Atom 1.0.

<link customAttribute="value" rel="alternate" type="text/html" title="Link Title" length="1000" href="http://server/link" />

The following XML shows how the RelationshipType property is serialized to RSS 2.0.

<a10:link customAttribute="value" rel="alternate" type="text/html" title="Link Title" length="1000" href="http://server/link" />

Remarks

Well-known relationship types include:

  • alternate - The link identifies an alternate version of the resource described by the containing Feed or Item.

  • related - The link identifies a resource related to the containing Feed or Item.

  • self - The link identifies a resource equivalent to the containing Feed or Item.

  • enclosure - The link identifies a related resource that is potentially large in size and might require special handling. This link relation is often used when podcasts or audio files are distributed in a Feed.

  • via - The link identifies a resource that is the source of the information provided in the containing Feed or Item.

When serialized to Atom 1.0 this value is written out as the rel attribute of the <link> element. When serialized to RSS 2.0, this value is written out as the rel attribute in the <a10:link> element.

Applies to