Reputation: 1
I'm trying to do this:
<h1> Pagina [email protected]</h1>
But, when I start the page the text is this:
Pagina [email protected]
How can I join the variable Model.Restaurant.Id with a text? Like this:
Model.Restaurant.Id = 5
Pagina n5
Thanks for your help!
Upvotes: 0
Views: 55
Reputation: 590
Try this:
<h1> Pagina n<%= Model.Restaurant.Id %></h1>
or
<h1> Pagina n<%: Model.Restaurant.Id %></h1>
or
<h1> Pagina n@(Model.Restaurant.Id) %></h1>
Upvotes: 0
Reputation: 1340
You can use string interpolation.
<h1>@($"Pagina n{Model.Restaurant.Id}")</h1>
Upvotes: 2