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
korchev
January 18, 2022, 12:24pm
4
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:
I am using Radzen IDE to scaffold out a lot of CRUD pages.
For some of them, I want to just pass and ID on a query string generated outside of the application into specific Radzen IDE generated pages.
Is it possible to consume that ID passed on on a query string then use that to pass in for the record to load in a grid or in a form?
I have a differnet blazor application I don't have time to build out dozens of look up tables, I just want to pass over the ID and have the Radzen IDE form or gri…
Hi @Dwight_Rutledge ,
You can use query string to pass a parameter to some of the pages and later read this query string and use it with $filter for the data source method to filter your data. Here is how to get a query string value:
${(new URL(window.location.href)).searchParams.get("CustomerID")}
and here is how to use it in Radzen page to invoke and filter data source data:
[image]
[image]
[image]
[image]
Best Regards,
Vladimir
b.r/
Mehmet
The second link is for Angular and already has a working solution. I will link my reply to the first one.