Click or drag to resize
CampaignAssetUrlInfoHelperNormalizeAssetUrlTargetInternal Method
Creates valid URL target that is relative path from the website root without scheme, port, domain, query strings, fragments and trailing slash at the end. If the url is already normalized format IsNormalizedUrlTarget(String), then it is returned.

Namespace: CMS.WebAnalytics
Assembly: CMS.WebAnalytics (in CMS.WebAnalytics.dll) Version: 10.0.0
Syntax
C#
protected virtual string NormalizeAssetUrlTargetInternal(
	string url,
	SiteInfo site = null
)

Parameters

url
Type: SystemString
URL to be changed to correct format.
site (Optional)
Type: CMS.SiteProviderSiteInfo
SiteInfo that has SiteIsContentOnly set to true with correctly set SitePresentationURL. Valid URL target will be created as relative path from SitePresentationURL.

Return Value

Type: String
Returns valid URL for CampaignAssetUrlTarget property from given URL or returns empty string when url can't be normalized.
Exceptions
ExceptionCondition
UriFormatExceptionGiven url is an invalid Uniform Resource Identifier (URI).
ArgumentExceptionSite is not content only or does not contain correct SitePresentationURL.
InvalidOperationException When given url does not belong to given site (url is checked against site's SitePresentationURL).
Examples

If site's presentation url 'http://your-domain.com/virt_dir/' and url is 'http://your-domain.com/virt_dir/some_page', then returned URL is '/some_page'.

'http://your-domain.com/landing_page/' is not normalized.

String.Empty is not normalized.

'/' is normalized.

'landing/page' is not normalized.

'/landing/page' is normalized.

'/landing/page/' is not normalized.

See Also