yes build visual studio project add umbraco dlls and then copy over project dll to web site bin folder and view in to Partials folder and macro view in macro Partials folder ....
I do not want to create too many templates for each custom forms that I need to add to sites as I have old version 4 site with customer portal where I have login system, account management, shopping cart , quote tool and many more .... all in web forms, so I was looking at possibility of converting them in to MVC and recreate version 7 site.
but this is not near possible as I cannot resolve this route table issue for 4 days ...... feel like pulling all my hair out :(
Could not find a Surface controller route in the RouteTable for controller name error
Hi all,
I have created a form using MVC and insert in to a RTE (not inside a Grid)
Form load fine and on submit I get this error "Could not find a Surface controller route in the RouteTable for controller name"
How to sort this issue please
Hi Pat
Can you share the code of form and surface controller?
I have seen this topics about routing for controllers which I didn't get properly.
Hi pat
I think the problem is with action of form, can you check "action" attribute of your form?
Thanks
hi this is my form
Hi Pat
Try to use this code:
I hope it will help you
Thanks,
Alex
There is a nuget package called routedebugger that is pretty helpful in identifying issues like this.
Can you change your Index method to see what happens when you use:
If that does not work either, can you show the code of the macro's MacroPartials view?
hi Micha, I have tried above and my partial View Macro File is ready as below.
I have created macro and set above script. still get same error.
Hi Pat
Did you build you solution?
Where is your controller code placed?
Is it website?
yes build visual studio project add umbraco dlls and then copy over project dll to web site bin folder and view in to Partials folder and macro view in macro Partials folder ....
I do not want to create too many templates for each custom forms that I need to add to sites as I have old version 4 site with customer portal where I have login system, account management, shopping cart , quote tool and many more .... all in web forms, so I was looking at possibility of converting them in to MVC and recreate version 7 site.
but this is not near possible as I cannot resolve this route table issue for 4 days ...... feel like pulling all my hair out :(
If you want to call the surface controller's Index method, the partial view macro page should look like this:
Hi Mica, I have tried Index method like that then form not rendering at all
Hi Alex, you were correct in earlier, I need to call contactuscontroller in view beginumbracoform
but I was struggling as I just tried ContactUsController in
As I have copied .dll I need give full path for it ... as below
just released this after reading Shannon Deminick reply on below post
https://our.umbraco.org/forum/developers/api-questions/38662-v6-Could-not-find-a-Surface-controller-route-error?p=0
thanks for your support big relief :)
Hi Pat
I'm really glad to help you. Have a nice day!
Thanks,
Alex
is working on a reply...