【发布时间】:2026-02-11 07:00:02
【问题描述】:
我继承了一个正在迁移到网络的数据库。问题是一些字符串字段有html字符....
一个例子是......
"" 没有引号,它不会出现在这里,尝试别的东西。无论如何,它有 符号,中间有文字。
如何避免任何可能的 html 引用组合。
SelectCommand="usp_getSingleStringData" SelectCommandType="StoredProcedure"
<SelectParameters>
<asp:SessionParameter Name="shrtText" SessionField="shrtText" Type="String" />
<asp:SessionParameter Name="tableName" SessionField="currUserTable" Type="String" />
</SelectParameters>
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
If DropDownList1.SelectedValue = "Select" Then
GridView1.Visible = False
Exit Sub
End If
GridView1.Visible = True
Dim TestString As String = DropDownList1.SelectedValue
Dim EncodedString As String = Server.HtmlEncode(TestString)
Session("shrtText") = EncodedString
End Sub
错误信息是....
从客户端检测到具有潜在危险的 Request.Form 值 (ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$DropDownList1="")。
也试过 Texbox,
从客户端检测到有潜在危险的 Request.Form 值 (ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$GridView3$ctl17$TextBox1="")。
感谢您的帮助
【问题讨论】:
标签: asp.net vb.net stored-procedures