How to get the simple address of a page in EPiServer
This post explains how to get the simple address of a page, if any. As it turns out, it's just a matter of getting the PageExternalURL property.
public string GetSimpleAddress(PageData page)
{
string url;
//Fetch the simple address
try
{
url = (string)page.Property["PageExternalURL"].Value;
}
catch
{
url = string.Empty;
}
//Return the regular URL if no simple address was found
return (url != string.Empty ? url : page.LinkURL);
}