A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
I have a page type with a web form template that displays different integrated data based on two querystring int parameters.
The int's have a registry of URL friendly names.
I've looked at Joel's http://joelabrahamsson.com/custom-routing-for-episerver-content/ and created a RoutePartial method to be able to have a URL such as /createinquiry/mycategory-in-myregion/ instead of /createinquiry/?categoryid=666®ionid=888.
urlSegment above contains "testparam" extracted from the full URL /createinquiry/testparam/ which is exactly what I want. I will of course later resolve the correct ID's but for now I just use segmentContext.SetCustomRouteData() to attach hard coded int's to the request.
I don't need GetPartialVirtualPath() so I just return an empty object. Maybe it's better to return a NotImplementedException()?
In the web form I fetch the values using Request.RequestContext.GetCustomRouteData<int>("categoryid").
Is this a good approach and/or what other options do I have?
Is it possible to rewrite the request in RoutePartial so that my web form works just using Reqeust.QueryString["categoryid"] both routed and unrouted?