The reason your MVC controller isn't being hit is probably because you've yet to put in a dedicated route for it.
Out of the box, although MVC based, Umbraco replaces all of the routing to go through it's own routing behaviour. This makes various Umbraco things available to pages correctly.
You might be better off looking into using an Umbraco Surface Controller to do what you are doing.
Sorry Nik,
I'm going to need more help. where do I specify routes? how do I know what routes to specify? Actually how do I connect the partial view with get method from a surface controller?
This video, although not exactly what you are trying to do, should give you an understanding of Surface Controllers and Forms/Data https://www.youtube.com/watch?v=3V0A1AYJbys
The CodeShare tutorials are pretty decent so I do recommend them. It's easy to follow.
Let me know if you are still stuck after you've had a look at the video :-)
MVC Get doesn't load
Hi I have partial view
and I also have controller
The DisplayList get method is never executed and I need it to be executed.
Please Advice
Hi Sonja,
The reason your MVC controller isn't being hit is probably because you've yet to put in a dedicated route for it.
Out of the box, although MVC based, Umbraco replaces all of the routing to go through it's own routing behaviour. This makes various Umbraco things available to pages correctly.
You might be better off looking into using an Umbraco Surface Controller to do what you are doing.
The docs here should help you get an understanding of the routing that Umbraco does by default: https://our.umbraco.com/documentation/Implementation/Default-Routing/
This will help explain the Umbraco Controller options: https://our.umbraco.com/documentation/Implementation/Controllers/
And this can help you with custom routing: https://our.umbraco.com/documentation/Implementation/Custom-Routing/
See how you get on with those but if you need more help feel free to reach out :-)
Nik
Sorry Nik, I'm going to need more help. where do I specify routes? how do I know what routes to specify? Actually how do I connect the partial view with get method from a surface controller?
Thanks, Sonja
Hi Sonja,
No need to apologise :-)
This video, although not exactly what you are trying to do, should give you an understanding of Surface Controllers and Forms/Data https://www.youtube.com/watch?v=3V0A1AYJbys
The CodeShare tutorials are pretty decent so I do recommend them. It's easy to follow.
Let me know if you are still stuck after you've had a look at the video :-)
Nik
I found the answer in the video. I put @{Html.RenderAction("DisplayList", "ProductList", Model);}
is working on a reply...