Skip to content

Instantly share code, notes, and snippets.

@danlister
Last active August 29, 2015 14:08
Show Gist options
  • Save danlister/b2d65240cb0682152502 to your computer and use it in GitHub Desktop.
Save danlister/b2d65240cb0682152502 to your computer and use it in GitHub Desktop.
// The below action works correctly when a template exists
// for the current page. When a template has not been selected
// or does not exist, the ambiguous action method
// exception occurs.
//
// I'm starting think this is correct behaviour because
// MyPageController has an action called Index and so does
// RenderMvcController. Therefore, having duplicate routes.
//
// What I'm not quite certain about is why the exception
// only occurs when a view does not exist or when one has not
// been selected in the back office.
public class MyPageController : RenderMvcController
{
public ActionResult Index(RenderModel model)
{
return new RedirectToUmbracoPageResult(model.Content.Parent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment