Hi
I have to use override as Index is the RenderMvcController reserved page.
I am not passing in any extra parameters so the signature is the same.
Therefore i need to use override.
public class FeaturedPageController : RenderMvcController
{
public override ActionResult Index(ContentModel model)
{
return CurrentTemplate(model);
}
}
I don't think you can call a rendermvc controller using RenderAction, it is meant for hijacking a page url, you should probably be using a surfacecontroller to do what you are trying.
Page within a page
Hi everyone,
This may be very simple to someone, but I have been scratching my head how to do it !
I have created a Published Page / Document Type and I am looking to insert within this page a carousel displaying featured items.
The featured items of this carousel are chosen as part of another Document Type (Content Page) with a Data Type (Multi-List) which I have created...
Here is my issue...
I am trying to get this featured page within the main page but I cant seem to do it. I always run into the usual errors of Model mis-match etc.
I have tried adding
to the Main Page html and,
in the controller, but I just get this error "No route in the route table matches the supplied values."
Could anyone be kind enough to help me please?
Many thanks Mark
How is your controller defined? Why are you using override?
Hi I have to use override as Index is the RenderMvcController reserved page. I am not passing in any extra parameters so the signature is the same. Therefore i need to use override.
something like this..
thanks Mark
I should also add, i am using "Index" as I thought this was the only way to access the Data Type List i have used on the Content Model of the page...
Otherwise, I would have just created another ActionResult page
Thank you Mark
your fist piece of code references FeaturedCarouselPage
you say your controller is called FeaturedPageController so you have a mismatch.
I am not using override, infact VS complains if you do as no overrideable method
Sorry, my mistake.
The Controller is FeaturedCarouselPageController
I will try "not" using override now...
thanks Mark
Hi Huw,
Just tried it and I get same issue.
"No route in the route table matches the supplied values."
Thanks Mark
I don't think you can call a rendermvc controller using RenderAction, it is meant for hijacking a page url, you should probably be using a surfacecontroller to do what you are trying.
ah ok, I will try that Huw,
Thank you Mark
looks like by inheriting from SurfaceController, I lose the ability to return CurrentTemplate.
as CurrentTemplate does not exist in the current context
Arghhhh !
Thanks Mark
you can't render a page within a page, your carousel should use a partial view that is returned by the controller.
normally you would define your carousel as a doctype and add that doctype to your main document type where you then add the images etc.
try looking at the codeshare starter kit, it contains code for a carousel
Hi Huw,
thanks for helping, i have done this.
My issue is still that i want the images to be added via Umbraco, and not "hard-coded" onto the partial view.
Thanks Mark
Checkout the codeshare starter kit, the images are added via the back office they are not hard coded in the partial view
Thanks Huw, just Googled it.
Will take a look.
Mark
is working on a reply...