Gets the Uniform Resource Identifier (URI) of the download request.

value = downloaderObject.Uri

Type: string

A string value that corresponds to the URI of the Downloader object request.

This property is read-only. The default value is an empty string.

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

When you invoke the Open method of the Downloader object, you specify a uri parameter that represents the data to be downloaded. The Uri property corresponds to the value of the uri parameter of the Open method. The Uri property provides a way to differentiate downloaded content if you use shared DownloadProgressChanged or Completed event handler functions for multiple Downloader object requests.


The Uri value must reference a file that comes from the same site of origin as the instantiated Silverlight plug-in. Usually, this is accomplished by specifying a relative URI.

The following JavaScript example shows how to use the Uri property in a Completed event handler function to determine what actions to take for the returned value of the GetResponseText method invocations. Because the downloaded content does not represent packaged content, the part parameter for GetResponseText must be set to an empty string.

// Event handler for the Completed event.
function onCompleted(sender, eventArgs)
    // If HTTP status code indicates "OK", determine action based on URI property.
    if (sender.uri == "OK_button.js")
        // Evaluate JavaScript code -- causes code to be memory-resident.

    if (sender.uri == "OK_button.xaml")
        // Retrieve downloaded XAML content.
        var xamlFragment = sender.ResponseText;

        // Create the objects from the XAML content.
        var plugin = sender.getHost();
        var button = plugin.content.createFromXaml(xamlFragment);

        // Add downloaded XAML content to the root Canvas of the plug-in.
        var rootCanvas = sender.findName("rootCanvas");

Community Additions