I need to create this output via RazorEngine:
<element attr1="@SomeText"></element>
So in my cshtml file I typed up this:
<element attr1="@@@Model.SomeProp"></element >
The problem I'm facing is that escaping @ with @@ causes an error in RazorEngine.
Before you suggest "& #64;" I must add that
<element attr1="@SomeText"></element>
will not do in my case (don't ask me why)
What can you suggest as a solution?
Nothing comes to mind other than creating a global constant and using it thus
<element attr1="@Class1.At@Model.SomeProp"></element >
PS: The error I'm getting is:
Parser Error Message: "@" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.
<element attr1='@Html.Raw("@")@Model.PortNumber'></element>