Generating links in HTML through C#

Working on my project, I have come to the point where I am generating links to other pages on the project, through C# code, as C# connects to a search system and returns the results as a long HTML string which is rendered in radzen through a internal DIV.

My issue is that there is a big difference between the buttons I am creating with C# by using
string = "<a href='" + linkresult + "'" + Title +"

And the links and buttons created through Radzen, where the page itself does not seem to "reload" only the internal content of the layout changes.

Is there any way for me to write HTML through C# where it would result in something similar? Where the layout of the page stays and only the internal content is changed.

Hi @Levi_Barrocas,

What you see in Radzen applications is the Angular Router. It provides navigation without reloading the page - it renders a different component and keeps the layout the same. If you use the Radzen Link component and link to a Radzen application page you will have the same effect. If you use a regular <a href=""> it will perform the normal browser navigation and refresh the whole page.

Huh so could these links be generated in C#? Right now my attempts to do so failed, if I was to create a link like this in an http text on my app do you know what I would need to write? Or is this something that needs to be pre-baked on the site and can't be created in realtime?

Not sure what "an http text on my app" means. The Angular Router works in Angular applications (such as Radzen). If you have other HTML pages in your application the Angular Router won't work.

So we have the HTML component in radzen, I have a C# code that is writing a html search result into that component. Would it be possible for the HTML in the HTML component to have these kind of links?

How are you writing the C# search result in the HTML component?

Radzen runs a custom method, that asks the search system in manticore for the results. That writes a html code with all the results and links, and then it is returned to radzen where it is put into a variable/page property.

Then the html component has this as value:

<div [innerHTML]="VARIABLE HERE"></div>

Got it. No, in this case the links wont use the Angular Router and will navigate as regular links.

No way to write a angular router link on that?

No as far as I know.

Oki then, I will do some tests over here and see if I find some reasonable way of doing this, the search results seem to be too dynamic for what Radzen normally allows with default components and such.