In my template, I am returning a partial view using the following code:
@Html.Action("ShowBookingForm", "TourBooking")
What I now need to do is access a property on the current page from within the ShowBookingForm partial view. How can I do this as my partial view is defined as follows:
Accessing Model.Content in a HTML.Action call
Hi all,
I have been following this tutorial closely to try and produce a booking process for my site.
http://umbraco.com/follow-us/blog-archive/2015/2/13/creating-multi-step-forms-using-a-surfacecontroller
In my template, I am returning a partial view using the following code:
What I now need to do is access a property on the current page from within the ShowBookingForm partial view. How can I do this as my partial view is defined as follows:
This means that I cannot access the page properties because I do not inherit from:
Any help would be greatly appreciated.
Did you try this: @inherits Umbraco.Web.Mvc.UmbracoViewPage
Hi Jason,
You could add the property to your model and set it in your ShowBookingForm method where you'll have access to CurrentPage.
is working on a reply...