Back
Theme:

concatenation of c# razor string with HTML string


how can I concatenate c# razor with HTML string?

Date: Thursday, November 23, 2023
2 answers | 393 view(s)
by Mauricio Junior

Answers

You can do this.

@if (value) { @("R$ "+ course.CoursePrice) } else { @("$ " + course.CoursePrice) }

Thursday, November 23, 2023

Mauricio Junior


The secret is

@("string" + c# code);

Thursday, November 23, 2023

Mauricio Junior


Curso de Web API com .NET última versão