Try our conversational search powered by Generative AI!

Check if a file is referenced by a Page



I'm doing a search for files in Documents, and wonder if it's possible to check if a found file is referenced by a Page, and of course, which page it is. When you try to delete or move a file in the File Manager you get a warning if the file is referenced by a Page, so I suppose it could be done in code-behind?

// Kind regards, Torbjörn

Jan 28, 2010 12:15


Yes, you can do so by using the SoftLink class. Use SoftLink.Load and you should get a collection of softlinks where you can see what pages are referencing that file.


Per Gunsarfs
EPiServer development team

Jan 28, 2010 13:46


That's really smooth, thanks a lot, Per.

Made my code cleaner and faster, since my initial solution was to fetch a PageDataCollection and loop through it .

// Regards, Torbjörn 

Jan 28, 2010 19:41
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.