URL link parameter for Id dynamic object set as string

I am trying to create a URL link that will show a contact details when that contact name is selected. Creating suitable parameters generates code defining the parameter as such:
[Parameter]
public dynamic ContactId { get; set; }
This is the same for other code generated to handle the standard grid line item select for record edit, passing ContactId to the appropriate get method/ etc.
The custom URL includes the ContactId in the URL as parameter thus :
localhost:5000:display-contact/123 (123 being the appropriate ContactId).
The ContactId is however received as a string in the ShowContactComponent class - generating a runtime error. If the variable is manually updated via VS debug to integer the data is displayed as expected.
I cant see any obvious solution to this in the Radzen tool t ensure the code generated handles the parameter correctly.
Anyone seen this/ have a possible solution?

Many thanks!

1 Like

You may also cast explicitly before passing page parameters
image

Many thanks for your reply, pointed me in the right direction. Found that the following worked for me in the parameter properties
image

Cheers,

This was a big help, but I was hoping for something like this, to make the page parameter optional. It currently won't render the page if I don't include a parameter in the URL:

(int?)${parameters.CustomerID}

I too am using Blazor server-side.