Monday, March 3, 2014

How to programatically deal with AAM

copyright from: www.stefan-walter.net
Sometimes you have to pay attention to AAM (Alternate Access Mapping) when programming for SharePoint. If you are working with such an environment you have only two options.
Either you use only server realtiv paths or you get the correct URI out of the AlternateUrlCollections from the farm. The following code explains how to programatically get the correct URI when using AAM programatically. One disadvantage of this solution is that you can not use it in sandboxed solutions. For example atSWCustomRibbon or SWShowPermissions this technique is applied.

No comments: