Html.BeginUmbracoForm doesn't work properly when using UmbracoVirtualNodeByIdRouteHandler
I have a page which is a virtual one using your UmbracoVirtualNodeByIdRouteHandler to create the routes.
If I put a standard form on the page using Html.BeginUmbracoForm and post it to any SurfaceController. The Action on the SurfaceController is never triggered, it just reloads the page the form is on?
Any ideas? I'm so close to a good setup on a package I want to release.
and you are using UmbracoVirtualNodeByIdRouteHandler.
The reason you have to use UmbracoVirtualNodeByIdRouteHandler is because Umbraco has no idea what
/hello/world
actually is. This is the same exact reason that BeginUmbracoForm doesn't work - because you are operating 'outside' of Umbraco, you are really just using normal MVC. The UmbracoRouteHandler will not be executed (which processes BeginUmbracoForm) because your custom route is executing with your own route handler.
Since you are using normal MVC, then just use the normal MVC approach to creating forms: Html.BeginForm
I'm using an html action to a surface controller on a page which is also using the UmbracoVirtualNodeByIdRouteHandler. When I try to use the CurrentPage property I get the following exception:
Cannot find the Umbraco route definition in the route values, the request must be made in the context of an Umbraco request
Html.BeginUmbracoForm doesn't work properly when using UmbracoVirtualNodeByIdRouteHandler
I have a page which is a virtual one using your UmbracoVirtualNodeByIdRouteHandler to create the routes.
If I put a standard form on the page using Html.BeginUmbracoForm and post it to any SurfaceController. The Action on the SurfaceController is never triggered, it just reloads the page the form is on?
Any ideas? I'm so close to a good setup on a package I want to release.
Hi Lee,
Lets say you've created your own custom route to:
/hello/world
and you are using UmbracoVirtualNodeByIdRouteHandler.
The reason you have to use UmbracoVirtualNodeByIdRouteHandler is because Umbraco has no idea what
/hello/world
actually is. This is the same exact reason that BeginUmbracoForm doesn't work - because you are operating 'outside' of Umbraco, you are really just using normal MVC. The UmbracoRouteHandler will not be executed (which processes BeginUmbracoForm) because your custom route is executing with your own route handler.
Since you are using normal MVC, then just use the normal MVC approach to creating forms: Html.BeginForm
Hello,
I'm using an html action to a surface controller on a page which is also using the UmbracoVirtualNodeByIdRouteHandler. When I try to use the CurrentPage property I get the following exception:
Is this the same problem?
Jeroen
Please post steps to reproduce, version number, etc...
IIRC CurrentPage should work, it will be equal to your virtual node that you've assigned the request.
Instead of CurrentPage this does work:
Jeroen
Steps to reproduce:
Umbraco 7.3-beta3
Jeroen
Please log an issue then if you can reproduce it and please include the logic for your child action and your route handler.
Here are other issues logged for virtual nodes, be sure that your's is not a duplicate or if there are any work arounds:
http://issues.umbraco.org/issues/U4?q=UmbracoVirtualNodeRouteHandler
Hi Jeroen, Shannon
I just ran some tests on a 7.2.6 site and see the same behavior there. So it's not 7.3 related
The controller action for the virtual route has the CurrentPage property correctly filled.
But surface controller actions called from the template don't have it set.
Dave
is working on a reply...