3

かみそりの部分に問題があります。

@section tools {
<div class="btn-group"">
    <button class="btn dropdown-toggle" data-toggle="dropdown">
        Update every <span id="update_time_label" class="label label-info">10 s.</span>
        <span class="caret"></span>
    </button>
    <ul class="dropdown-menu">
        <li><a href="#" onclick="return SelfAction.setUpdateTime(1)">1 s.</a></li>
        <li><a href="#" onclick="return SelfAction.setUpdateTime(5)">5 s.</a></li>
        <li><a href="#" onclick="return SelfAction.setUpdateTime(10)">10 s.</a></li>
        <li><a href="#" onclick="return SelfAction.setUpdateTime(30)">30 s.</a></li>
        <li><a href="#" onclick="return SelfAction.setUpdateTime(60)">60 s.</a></li>
        <li><a href="#" onclick="return SelfAction.setUpdateTime(120)">120 s.</a></li>
    </ul>
</div>
<button class="btn" onclick="return SelfAction.loadNewItemsNow()">Update now</button>
} <-- Can't detect

コードからわかるように、閉じ括弧は検出されません。現在、C# と MVC4 を学習していますが、解決策が見つかりません。この大きな HTML ブロックにビューバッグを使用したくありません。大きな HTML ブロックの特定の終了タグがあるのではないでしょうか? のような@sectionStart何か@sectionEnd

4

1 に答える 1

4

の最後にある 2 番目の " を削除して、<div class="btn-group"">それが役立つかどうかを確認してください。Razor エンジンは非常に扱いにくく、そのようなばかげたことで文字列を探し続ける可能性があります。他のすべてが一致するため、終了}はストリング。

于 2013-01-21T19:28:57.753 に答える