Partager via


ResponseText

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets downloaded data from a successful download request.

value = downloaderObject.ResponseText

Property Value

Type: string

The downloaded data. As in HTML, the return value can be examined and is passed as a string in a packet, but ultimately it is interpreted by whatever property you set with this value.

Managed Equivalent

None. Downloader does not exist in the managed API. Generally you can use WebClient for downloads, which provides equivalent functionality.

Remarks

You generally use this property only from within the event handler for a Downloader Completed event. Outside this context, there is no guarantee that a ResponseText value is valid.

When a Downloader object request is completed and successful, the ResponseText property contains a representation of the downloaded content as a string value. The value can represent XAML content, JavaScript content, or a media asset, such as an image.

If you are requesting parts of a package, use GetResponseText.

NoteNote:

If you are downloading media assets for use by the Source property of Image and MediaElement objects, you should consider using the SetSource (Image) or SetSource (MediaElement) methods instead of setting an object with GetResponseText or ResponseText, and then setting the Source properties. This is a more efficient way to transfer large-sized media assets. Image also has an equivalent SetSource.

Applies To

Downloader