Progress® Telerik® Reporting R3 2017

ReportViewerEnsureAbsoluteUri Method

Determines whether the given Uri is absolute. If not, creates a new absolute Uri based on the combination of Source for the current application and the given relative URI.

Namespace:  Telerik.ReportViewer.Silverlight
Assembly:  Telerik.ReportViewer.Silverlight (in Telerik.ReportViewer.Silverlight.dll)

Syntax

public static Uri EnsureAbsoluteUri(
	Uri uri
)

Parameters

uri
Type: SystemUri
The Uri that is being checked.

Return Value

Type: Uri
An absolute Uri.

Remarks

If the URI is absolute, the same instance is returned.

If the URI is relative, a new absolute Uri based on the combination of Source of the current application and the given relative URI is created. The Source usually points to the application package (XAP).

Examples

The following example shows some common scenarios and the absolute Uris returned. Consider that the Source Uri points to http://mydomain/MyWebSite/ClientBin/MyApp.xap:
//Absolute Uri (no change):
EnsureAbsoluteUri(new Uri("http://mydomain/MyWebSite/ReportService.svc", UriKind.Absolute));    // http://mydomain/MyWebSite/ReportService.svc
//Relative Uris:
EnsureAbsoluteUri(new Uri("ReportService.svc", UriKind.Relative)); // http://mydomain/MyWebSite/ClientBin/ReportService.svc
EnsureAbsoluteUri(new Uri("../ReportService.svc", UriKind.Relative)); // http://mydomain/MyWebSite/ReportService.svc 
EnsureAbsoluteUri(new Uri("/ReportService.svc", UriKind.Relative)); // http://mydomain/ReportService.svc

See Also