In MVC3 (e.g. Razor 1.0) double works, e.g. @@ :
<img src="..." alt="Find me on twitter as @@username" />
But in MVC4 (e.g. Razor 2.0), something has changed and it no longer works (maybe this is an error ...).
So, since you are allowed to have a code block for the attribute, you need to write a code block with @(...) , from where you can return @ :
<img src="..." alt="Find me on twitter as @("@username")" />
or
<img src="..." alt="Find me on twitter as @("@")username" />
As far as I know, web pages 2.0 use Razor 2.0.
source share