Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concatenate tag attribute value using Razor and a prefix

How do I do this in Razor (VB.NET):

<div class="[email protected]">

If @ViewBag.MyValue is "xxx", the output should be

<div class="some_prefix_xxx">
like image 417
Jakob Gade Avatar asked Jun 16 '11 16:06

Jakob Gade


1 Answers

Use parentheses:

<div class="some_prefix_@(ViewBag.MyValue)">
like image 124
Ethan Cabiac Avatar answered Oct 14 '22 22:10

Ethan Cabiac