Check if Url property is external or internal

Vote:
 

Hi!

I have a property of type Url, and I want to check if it is internal or external. How do I do that?

Url link = CurrentBlock.RelatedInfoLink;

link.?

#113304
Nov 18, 2014 12:23
Vote:
 

Hi!

How do you mean internal link? You mean the link used in CMS edit mode or the permanent link?

/Q

#113306
Nov 18, 2014 12:57
Vote:
 

I'm assuming you want to check if your link points to an internal page or an external URL.

The URL property type doesn't have a method for checking that. 

I think the closest you can get is to check if link.Host matches your siteUrl.

#113331
Edited, Nov 18, 2014 14:30
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.