0

I've a code like below on razor where we need @videoPlayer is actually a string and would like to retain as it is.

<param name="@videoPlayer" value="@model.id" />

At the moment razor view thinks that @videoPlayer is the variable and tries to convert.

How do I retain and out put as it.

Nil Pun
  • 17,035
  • 39
  • 172
  • 294
  • 1
    possible duplicate of [Escape @ character in razor view engine](http://stackoverflow.com/questions/3626250/escape-character-in-razor-view-engine) – RobH Aug 13 '14 at 14:11

2 Answers2

0

Try replacing it with this code

<param name="&#64;videoPlayer" value="&#64;model.id" />

It would be rendered at HTML once it is sent back to the browser.

Afzaal Ahmad Zeeshan
  • 15,669
  • 12
  • 55
  • 103
0

use a double '@' symbol

<param name="@@videoPlayer" value="@model.id" />
Anthony Shaw
  • 8,146
  • 4
  • 44
  • 62