【问题标题】:Does Html.LabelFor or Html.TextBoxFor automatically call Html.Encode?Html.LabelFor 或 Html.TextBoxFor 是否自动调用 Html.Encode?
【发布时间】:2023-03-30 12:08:02
【问题描述】:

即使我只使用 Html.LabelFor 和 Html.TextBoxFor 或类似函数而不直接使用文本,我是否还需要调用 html.ecnode?​​p>

【问题讨论】:

    标签: asp.net-mvc sql-injection html.encode


    【解决方案1】:

    如果你在 (mvc2) 中调用 html.textboxfor 和 htmp.textbox

            <%: Html.TextBoxFor(x=> x.MyName) %>
    

    那么就不需要调用html.encode了。

    : 在

    SO Question了解更多详情

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-24
      • 2013-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多