Hijack Routing not working for anything other than index
Hello,
We are currently adding umbraco into an existing MVC site and have followed the hijack method to get the current pages working however it seems only the index method works. Other methods result in a 404.
Any ideas? Should I move these into a surface controller?
public class DocumentsController : Umbraco.Web.Mvc.RenderMvcController
{
public DocumentsController()
{
}
public async Task<ActionResult> Index()
{
FileStorageModel fileStorageModel = new FileStorageModel(CurrentPage);
return CurrentTemplate(fileStorageModel);
}
[AcceptVerbs(HttpVerbs.Post)]
public async Task<ActionResult> UploadDocuments(IEnumerable<HttpPostedFileBase> files, int userId, int parentFolderId, int userChoice)
{
..... Cant hit this
}
}
Route Hijacking only uses the default route for the document type that you hijacked which is the Index one. If you need additional routes you can register them in the RouteTable the normal MVC way. Keep in mind that there is also an extension method called MapUmbracoRoute to map Routes to "Nodes".
Hijack Routing not working for anything other than index
Hello,
We are currently adding umbraco into an existing MVC site and have followed the hijack method to get the current pages working however it seems only the index method works. Other methods result in a 404.
Any ideas? Should I move these into a surface controller?
Hi Benjamin,
Route Hijacking only uses the default route for the document type that you hijacked which is the Index one. If you need additional routes you can register them in the RouteTable the normal MVC way. Keep in mind that there is also an extension method called MapUmbracoRoute to map Routes to "Nodes".
Regards David
is working on a reply...