Reputation: 1314
I have a size
variable which I need to insert in HTML, like this:
<img src="/Content/img/icons/[email protected]" />
to get something like this:
<img src="/Content/img/icons/coins_16.png" />
But ASP.NET thinks that png
is a method of size
. Is there a way to escape the dot coming after the variable?
Upvotes: 29
Views: 6242
Reputation: 101
Just had to do something very similar earlier today. This should work for you:
<img src="/Content/img/icons/coins_@(size).png" />
Upvotes: 4
Reputation: 9881
Add parentheses:
<img src="/Content/img/icons/coins_@(size).png" />
Upvotes: 49