I don't see why you are trying to register a route for your surface controller. For one, surface controllers generate a route for you. Secondly, surface controllers use a mechanism other than the URL to perform routing.
If you are going to define your own route rather than use the route automatically created by the surface controller, perhaps you should consider a RenderMvcController. See here: http://stackoverflow.com/a/27526619/2052963
A RenderMvcController is similar to a surface controller, except you need to create your route for your RenderMvcController, which may be appropriate considering you are attempting to create your own route.
Controller routes and Post request from FormPost gives an error
Hi Im trying to make a Email Verification on my webpage for a newsletter ..
Im Using a Route Tabel to Make it a Link in a email.
The Surface controller is controling the Partial view for the Newsletter form and a post including the Verifiy Url path
The ting is the Subscribe ActionResult breakes when i make the Route in the route tabel
and the same with Verify ...
What am i doing wrong ? The error i get is this..
A possible solution is to seperate the Controller out in to 2 one for the default action and one for Route.....
I don't see why you are trying to register a route for your surface controller. For one, surface controllers generate a route for you. Secondly, surface controllers use a mechanism other than the URL to perform routing.
See here for information on the routing that does not require a particular URL: https://github.com/Nicholas-Westby/LearnUmbraco7/blob/ab9da855fb3a31c816117931ac1997afdc47a82b/Chapter%2006%20-%20Surface%2C%20WebAPI%20and%20RenderMVC%20Controllers/02%20-%20Surface%20Controllers.md#special-routing
You can scroll up that page for information about the default routes Umbraco generates for surface controllers.
The main reason was to bunch together Functions in a controller that made sense to have together .
The Web site Would be somthing like this..
Newsletter SubscribeForm - A partial View with a Webform
Newsletter Subscribe Post - the post to submit data to umbraco and Create a newsletter
Newsletter Verify - The route from a site that Verifies the Registered email http://URL/Verify/Newsletter/{ID}/{VerificationCode}
The address in then included in a email send to the User under post ...
If you are going to define your own route rather than use the route automatically created by the surface controller, perhaps you should consider a RenderMvcController. See here: http://stackoverflow.com/a/27526619/2052963
A RenderMvcController is similar to a surface controller, except you need to create your route for your RenderMvcController, which may be appropriate considering you are attempting to create your own route.
is working on a reply...