Created
May 15, 2016 16:09
-
-
Save casper-rasmussen/88274446d95a52a6dd981cbb0884b03b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override object RoutePartial(PageData content, SegmentContext segmentContext) | |
{ | |
//Ask Episerver to resolve the object for requested URL | |
object ob = base.RoutePartial(content, segmentContext); | |
if (ob != null) | |
{ | |
SegmentPair segment = segmentContext.GetNextValue(segmentContext.RemainingPath); | |
if (!String.IsNullOrWhiteSpace(segment.Next)) | |
{ | |
//If segment is a part of our predfined list | |
if (this._segments.Contains(segment.Next, StringComparer.InvariantCultureIgnoreCase)) | |
{ | |
//Then don't tell Episerver about the segment and ensure that it is skipped. | |
segmentContext.RemainingPath = segment.Remaining; | |
return ob; | |
} | |
} | |
} | |
return ob; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment