SaaS CMS has officially launched! Learn more now.

Route attributes in a page controller?

Vote:
 

Hello,

I'd like to ask what would be the best approach if I need a route attribute in a page controller (with longer routes behavior as it is). Is there a way how to do it or do I have to create my own routing template that would replace the Epi routing?

    public class ContactPageController : PageController<ContactPage>
    {
        public ActionResult Index(ContactPage currentPage)
        {
            var model = new ContactPageViewModel(currentPage);

            return View(model);
        }

        [Route("{area}")]
        public ActionResult ContactArea(ContactPage currentPage, string area = "")
        {
            var model = new ContactPageViewModel(currentPage, area);

            return View(model);
        }
    }

Thanks

Petr

#324865
Jul 03, 2024 13:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.