[训练]ASP.NET MVC 5 – Razer语法使用1

//MVC3開始,新增Razer語法,不同於先前的<%...%>括號語法,使用At Sgin(@)敘述程式碼片段。    //在Razer檢視中,使用@*...*@進行程式註解。    //在程式碼中,要輸出內容,要加@或@(...)  //在html標籤中,要輸出內容,要加@  //在程式碼中,要輸出純文字,要加@:
  @if(true)  {      String strPrint = "這是測試輸出文字";      @strPrint<br/>      <span>strPring</span><br />      <span>@strPrint</span><br />  }    @{string strl = "測試";}  @(strl)輸出文字<br />    @{ string strHtml1 = "<ul><li>項目一</li></ul>";}  @Html.Raw(strHtml1)<br />  

发表评论

请注意:: 评论审核已启用,可能会耽误您的评论. 有没有必要重新提交您的评论.