API
Version 7.x > API > GetPageInfoForUrl View modes: 
User avatar
Member
Member
beau.cowan-rrpartners - 5/13/2013 8:10:52 PM
   
GetPageInfoForUrl
I'd like to be able to check to see if a url exists in the system before continuing on a certain task.

I found the PageInfoProvider.GetPageInfoForUrl method, but I'm lost on how to use it at this time. Can someone give me some quick pointers on this?

Oh, and if possible, do it like on Firefly, with dumb captain words.

User avatar
Member
Member
kentico_sandroj - 5/13/2013 8:38:46 PM
   
RE:GetPageInfoForUrl
Hi,

I've found a few "simple" solutions on Stackoverflow. Another option would be reviewing the internal LinkChecker which is a lot more advanced, but harder to customize:

~\CMSAdminControls\Validation\LinkChecker.ascx.cs

Please let me know if you would like any additional clarification.

Regards,
Sandro

User avatar
Member
Member
beau.cowan-rrpartners - 5/15/2013 7:31:30 PM
   
RE:GetPageInfoForUrl
Thank you your help. I was able to figure out how to use my original solution after looking into what an "out" actually does.

And of course, after trying to figure out the rest of this solution, my manager opted for a solution in the web config instead, which actually makes more sense for our project.

Although, for future reference, it would be nice to have something in the API that would be something like UrlExists(url) and have it spit out a boolean. Would make things so much easier.