Razor view engine, how to write inbetween html?

前端 未结 2 1152
粉色の甜心
粉色の甜心 2021-02-20 01:17

i have some problem with a razor syntax. I would like to know how to write inbetween html.. see this sample..

    @foreach (var x in Model) {
相关标签:
2条回答
  • 2021-02-20 01:34

    Does using the <text> tag work? For example:

    <text>No tags</text>
    
    0 讨论(0)
  • 2021-02-20 01:50

    You need to explicitly tell Razor that you're writing HTML, by writing @:No Tags or <text>No Tags</text>.

    0 讨论(0)
提交回复
热议问题