does anybody know how to force Razor View engine to print exact line which is under foreach loop. Code follows :
@section head{
Inside the @foreach block, the content is code by default unless you switch back to markup. So the "jQuery(...).progressBar()" line is considered C#. In cases like this, where you want markup that isn't HTML, you can use the
Also, the "pb@PlayerID" looks like an email address to Razor so it ignores it. You can avoid that by using the @() explict expression syntax. So the @foreach block should look like this:
@foreach(var player in Model)
{
@: jQuery("#pb@(PlayerID)").progressBar();
}