Skip to content

Instantly share code, notes, and snippets.

@mattbrailsford
Last active November 25, 2019 10:43
Show Gist options
  • Save mattbrailsford/7f6f04fd8b0e55dde90eea96ebb59d87 to your computer and use it in GitHub Desktop.
Save mattbrailsford/7f6f04fd8b0e55dde90eea96ebb59d87 to your computer and use it in GitHub Desktop.
public class MyController : SurfaceController, IRenderController
{
// Hijack route for doc type MyPage
[HijackRoute("MyPage")]
public ActionResult MyPage(ContentModel model)
{
// Do some stuff here, then return the base method
return base.Index(model);
}
// Hijack route for doc type MyPage using template MyTemplate
[HijackRoute("MyPage", "MyTemplate")]
public ActionResult MyOtherPage(ContentModel model)
{
// Do some stuff here, then return the base method
return base.Index(model);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment