【问题标题】:save html tag data to sql server in c#在c#中将html标签数据保存到sql server
【发布时间】:2013-10-01 07:26:33
【问题描述】:

我有一个表格矩阵:

Id   Title                           Format
1   Automated Phone plus Links  <span class="avg">{0}%</span><span class="xofy">({1}/{2})</span>

格式应该存储在跨度中。

当我们在 UI 中填充它时,它将显示为:

Id   Title                           Format
1   Automated Phone plus Links  {0}%({1}/{2})

问题,当我们从 UI 编辑时,我收到错误:

A potentially dangerous Request.Form value was detected from the client (ctl00$cph1$grdMatrixType$ctl00$ctl06$ctl02="<span class="avg">{0..."). 

有人可以建议如何解决此错误并将数据保存到具有跨度的数据库中吗?

提前谢谢..

【问题讨论】:

    标签: sql-server asp.net-mvc c#-4.0


    【解决方案1】:

    添加

    ValidateRequest = "false"
    

    到页面指令对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-18
      • 2011-05-02
      • 1970-01-01
      • 2015-08-15
      • 2011-03-30
      • 2013-06-26
      • 1970-01-01
      • 2013-08-28
      相关资源
      最近更新 更多