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 | 185 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


Learn database step by step in practice