# Passing additional data via PageRequestData?

**URL:** <https://forum.litium.com/t/passing-additional-data-via-pagerequestdata/1304>\
**Category:** Questions\
**Tags:** litium-6\
**Created:** [January 31, 2020, 11:51am UTC](https://forum.litium.com/t/passing-additional-data-via-pagerequestdata/1304 "2020-01-31T11:51:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ullmark](https://avatars.discourse-cdn.com/v4/letter/u/a9adbd/32.png) [@ullmark](https://forum.litium.com/u/ullmark)\
**Post date:** [January 31, 2020, 11:51am UTC](https://forum.litium.com/t/passing-additional-data-via-pagerequestdata/1304/1 "2020-01-31T11:51:15Z")

</div>

To solve my previous question re. [“Catch All Pages”](https://forum.litium.com/t/is-there-a-built-in-way-of-doing-catch-all-pages/1170/3) I built a solution where I can add an attribute `[CatchAllPageType]` to the page type definitions of pages where I want “Catch all relative routing” and then the `IPageNotFoundResolver` when getting a 404 checks the paths to determine whether it should render a page.

The question I have now, If I need to pass additional data over to the controller/view via PageNotFoundResolver is there something I can use on `PageRequestData`? It has a `Data` property with no documentation that I can find. Is that useable somehow?

Litium version: _6.3.7_

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [January 31, 2020, 12:40pm UTC](https://forum.litium.com/t/passing-additional-data-via-pagerequestdata/1304/2 "2020-01-31T12:40:26Z")

</div>

Use the `PageRequestData.NamedData` to pass data that you need. The `PageRequestData.Data` is used for product page types to pass the `ProductPageData` so the controllers know what category/product that should be rendered.

Btw, I’m interesting to hear the reason to not use the `INamedHandlerRouteResolver` that already exists in the product and instead build an own solution?

---

<div class="post-metadata">

**Author:** ![ullmark](https://avatars.discourse-cdn.com/v4/letter/u/a9adbd/32.png) [@ullmark](https://forum.litium.com/u/ullmark)\
**Post date:** [January 31, 2020, 1:17pm UTC](https://forum.litium.com/t/passing-additional-data-via-pagerequestdata/1304/3 "2020-01-31T13:17:36Z")

</div>

@patric.forsgard to be honest, we already had something solving another thing (in a way similar) we needed implemented in the not found resolver.

I needed it on four different page types, and your answer to my previous question made me feel that your proposed solution wasn’t really meant for this… but I can “try” it?

I can obviously change to making a “plugin” and “INamedHandlerRouteResolver”.

---

<div class="post-metadata">

**Author:** ![ullmark](https://avatars.discourse-cdn.com/v4/letter/u/a9adbd/32.png) [@ullmark](https://forum.litium.com/u/ullmark)\
**Post date:** [January 31, 2020, 1:29pm UTC](https://forum.litium.com/t/passing-additional-data-via-pagerequestdata/1304/4 "2020-01-31T13:29:15Z")

</div>

I only had a couple of lines of code, but I tried your solution from previous thread and it worked as well, moving over to that.

---

<div class="post-metadata">

**Author:** ![ullmark](https://avatars.discourse-cdn.com/v4/letter/u/a9adbd/32.png) [@ullmark](https://forum.litium.com/u/ullmark)\
**Post date:** [January 31, 2020, 1:33pm UTC](https://forum.litium.com/t/passing-additional-data-via-pagerequestdata/1304/5 "2020-01-31T13:33:00Z")

</div>

Scratch that. Your solution with `INamedHandlerRouteResolver` can only be used on one page type. So I would need to duplicate that class per page type.

@patric.forsgard I changed to having four different INamedHandlerRouteResolvers, that inherits from a common implementation. But I’ve tried for a while to understand HOW to get the values out that I assign to PageRequestData, but it always seem to be a “new” instance (when being assigned via dependency injection). How can I get the data extracted?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [February 28, 2020, 1:33pm UTC](https://forum.litium.com/t/passing-additional-data-via-pagerequestdata/1304/6 "2020-02-28T13:33:01Z")

</div>

Closed on February 28, 2020, 1:33pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
