CollapsiblePanelExtender 从客户端检测到潜在危险的 Request.Form 值
每当单击按钮折叠/展开面板时,我都会遇到此错误。 错误:CollapsiblePanelExtender 从客户端检测到潜在危险的 Request.Form 值。
有人可以告诉我我做错了什么以及造成这种情况的原因是什么?
<asp:Button ID="Button1" runat="server" Text="Button" />
<ajaxToolkit:CollapsiblePanelExtender
TargetControlID="testPanel"
ID="CollapsiblePanelExtender1"
runat="server"
ExpandControlid="Button1"
CollapseControlID="Button1"
Collapsed="False"
ExpandDirection="Vertical"
AutoCollapse="false"
AutoExpand="false">
</ajaxToolkit:CollapsiblePanelExtender>
<asp:Panel ID="testPanel" runat="server">
stuff here
</asp:Panel>
I am encountering this error whenever the button is clicked to collapse/expand the panel.
Error: CollapsiblePanelExtender A potentially dangerous Request.Form value was detected from the client.
Can someone tell me what I did wrong and what is causing this?
<asp:Button ID="Button1" runat="server" Text="Button" />
<ajaxToolkit:CollapsiblePanelExtender
TargetControlID="testPanel"
ID="CollapsiblePanelExtender1"
runat="server"
ExpandControlid="Button1"
CollapseControlID="Button1"
Collapsed="False"
ExpandDirection="Vertical"
AutoCollapse="false"
AutoExpand="false">
</ajaxToolkit:CollapsiblePanelExtender>
<asp:Panel ID="testPanel" runat="server">
stuff here
</asp:Panel>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
validateRequest="false"
放入页面指令或 web.config 文件中。向 ASP.NET 添加跨站点脚本保护(
例如, 如果您已经这样做)有:
那么这应该变成:
注意:
如果您使用的是 .NET 4,那么您需要将 requestValidationMode="2.0" 添加到 web.config 文件的 httpRuntime 配置部分。例如:
如果 web.config 文件中还没有 httpRuntime 部分,则该部分将位于该部分内。
谢谢
Put
validateRequest="false"
in your page directive or web.config file.Adding Cross-Site Scripting Protection to ASP.NET
for example if you already have:
then this should become:
Note:
If you are using .NET 4 then you will need to add requestValidationMode="2.0" to the httpRuntime configuration section of the web.config file. For example:
If you don't already have a httpRuntime section in the web.config file then this goes inside the section.
Thanks