Customise Href in Link

I would like to use data from a field as the search parameter in a hyperlink.
eg: https://www.google.com/maps/search/?api=1 ${tblClient.ClientAddress}

but this won't compile saying 'the type or namespace could not be found'

Anyone know the solution?

thanks

Hi John,

This expression is working for me in the Path prop of a Link component.

@($"https://www.bing.com/maps?q= {Customer.Address}")

or

@string.Format("https://www.bing.com/maps?q= {0}", Customer.Address)

in this case Customer is a page property that is set upon Grid RowSelect event.

HTH,
Josh

Josh,

many thanks that works.

Thats at least two virutal Beers i owe you.

Cheers

John

Josh,

as a matter of interest what is the syntax that you are using? How would one know to put the entire string inside brackets after the @ symbol? Where can i learn more about how to do this?

thanks

John

John,

It's SO syntax :grinning::

Kidding aside, it's actually Razor Syntax:

Radzen generates Razor Pages and has it's own logic for how ${data.Address} is translated into @(namespaceDatasourceNameModelName.Address) during generation. So when that logic doesn't fit the bill, you can always drop the dollar sign and go to straight Razor syntax with @(some razor syntaxt c# code here).

I'm sure there's a better explanation but that's my limited understanding and I just try things till it works.

the first example could be misleading cuz it adds c# string interpolation (completely different dollar sign than that used in Radzen) which is why I included the second example explicitly using string.Format()

HTH,
Josh

Many thanks :slight_smile: