Razor View中字符串中的语法高亮显示

时间:2016-07-14 23:26:50

标签: asp.net razor

我必须在部分视图的模型中传递一些html代码:

@Html.Partial("Widgets/_MetroTile", new GraphLiveDto
{
    FrontSlide = @"<h5 class='no-margin semi-bold p-b-5'>Apple Inc.</h5>
                <p class='no-margin text-black hint-text'>NASDAQ : AAPL - NOV 01 8:40 AM ET</p>
                <h3 class='semi-bold text-white'><i class='fa fa-sort-up small text-white'></i> 0.15 (0.13%)</h3>
                <p><span class='text-black'>Open</span> <span class='m-l-20 hint-text'>117.52</span></p>",

    BackSlide = @"<h5 class='no-margin semi-bold p-b-5'>Apple Inc.</h5>
                <p class='no-margin text-black hint-text'>NASDAQ : AAPL - NOV 01 8:40 AM ET</p>
                <h3 class='semi-bold text-white'><i class='fa fa-sort-up small text-white'></i> 0.15 (0.13%)</h3>
                <p><span class='text-black'>Open</span> <span class='m-l-20 hint-text'>117.52</span></p>"
})

问题是这种方法很难看。我想知道是否有办法在此代码中获得语法高亮。

提前致谢。

0 个答案:

没有答案