MVC的页面中经常会出现的标签:

mvc1: 

<%= Html.Encode(Model.Name)%> 

<%= Html.Encode(ViewData["text"]) %>   

mvc2:

<%: Model.Name%> 

<%: ViewData["text"] %>

mvc1中防止特殊字符或字符编码问题采用<%= Html.Encode()%>这种方式。

mvc2后就不需要Html.Encode()啦,只是把<%=%>变成啦<%:%>

相关文章:

  • 2021-10-21
  • 2022-12-23
  • 2022-03-02
  • 2021-06-30
  • 2021-05-13
猜你喜欢
  • 2021-05-24
  • 2022-12-23
  • 2021-10-24
  • 2022-03-01
  • 2022-12-23
  • 2021-12-25
  • 2022-01-13
相关资源
相似解决方案