开发者

CollapsiblePanelExtender A potentially dangerous Request.Form value was detected from the client

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="serve开发者_开发百科r"
    ExpandControlid="Button1"
    CollapseControlID="Button1" 
    Collapsed="False" 
    ExpandDirection="Vertical" 
    AutoCollapse="false" 
    AutoExpand="false">

</ajaxToolkit:CollapsiblePanelExtender>

<asp:Panel ID="testPanel" runat="server">
    stuff here
</asp:Panel>


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:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="MyForm.aspx.vb"  Inherits="Proj.MyForm"%>

then this should become:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="MyForm.aspx.vb" Inherits="Proj.MyForm" ValidateRequest="false"%>

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:

<httpRuntime requestValidationMode="2.0"/>

If you don't already have a httpRuntime section in the web.config file then this goes inside the section.

Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜