How to read page url/query parameter?

Hi there

I need to call a page directly from outside and pass parameters via URL like this:

http://localhost:8000/test?token=1234

How can I get the "token" parameter in the page (and i.e. pass it to a data call). I checked the ${parameters} object but it is always empty!

Hi @louis77,

The ${parameters} object is only available when page parameters are used (that map to Blazor route parameters). Query string parameters are a different concept. This blog post shows how to work with query string parameters in a Blazor application: https://www.mikesdotnetting.com/article/340/working-with-query-strings-in-blazor

Hi @korchev ,

I'm looking for an example on how to do this in Radzen IDE.
The blog post you are refering or any other page that explains how it works do not explain how to do it in Radzen. The goal is to stay as much as possible in the IDE and low code.

Could you provide an working example ? that retrievs one query parameter from the URL.

This question has been asked a lot in the forum.

br/
Mehmet

Every Radzen Blazor application with Security enabled has the following code:

var query = System.Web.HttpUtility.ParseQueryString(new Uri(UriHelper.ToAbsoluteUri(UriHelper.Uri).ToString()).Query);

var error = query.Get("error");

redirectUrl = query.Get("redirectUrl");;

That's how to work with query string parameters. Those are all Execute C# actions.

Can you point me to such questions so I can link my reply in this thread?

Hi @korchev ,

Thank you for your working example.

some forum items with ( I think ) same question:

b.r/
Mehmet

The second link is for Angular and already has a working solution. I will link my reply to the first one.