In my case i have a blog section in which listview of blogs is generated now i want to get all blog list and data in surface controller so i will add my custom logic there.
Most of the time, a SurfaceController is used for rendering MVC Child Actions and for handling form data submissions.
If you do the listview as a child action you could use a SurfaceController. Other ways would be a simple partial, just a template when passing in the model with a custom RenderMvcController or a Macro.
If there is a compelling reason to use a surface controller, (we have had a couple of cases), you need to pass the page Id into the method that does the rendering or have a way to determine what the page id is of the document you want to render.
I agree with the others though, generally speaking a RenderMvcController seems like the way to go.
Access umbraco Content in Surface Controller
How to access content data in Umbraco Surface controller. I want to access the content data in surface controller
Just use
Hope this helps
In my case i have a blog section in which listview of blogs is generated now i want to get all blog list and data in surface controller so i will add my custom logic there.
Most of the time, a
SurfaceController
is used for rendering MVC Child Actions and for handling form data submissions.If you do the listview as a child action you could use a SurfaceController. Other ways would be a simple partial, just a template when passing in the model with a custom RenderMvcController or a Macro.
Good luck with it!
I'd agree with Damiaan - sounds like you need a RenderMvcController rather than a SurfaceController.
If there is a compelling reason to use a surface controller, (we have had a couple of cases), you need to pass the page Id into the method that does the rendering or have a way to determine what the page id is of the document you want to render.
I agree with the others though, generally speaking a RenderMvcController seems like the way to go.
is working on a reply...