View Full Version : [CLOSED] ASP.NET Form Validation Request error when closing a Window containing a TextArea

Aug 25, 2014, 2:05 PM
When I run this code (press the button) I get a validationrequest error. How can get rid of this error without switching of this ASP.NET security feature.? It works fine when I use a Label instead of a TextArea.

protected void ErrorButton_Click(object sender, DirectEventArgs e)

<ext:Window runat="server" ID="IncidentErrorWindow" Title="Error Message" Hidden="true" Width="330" Icon="cancel" Closable="false">
<ext:FormPanel runat="server" Border="False" Padding="5" DefaultAnchor="100%" BodyStyle="background-color: #E0E0E0;" ButtonAlign="Center">
<ext:TextArea runat="server" ID="IncidentErrorMessage" MinHeight="120" ReadOnly="true" Margin="5" AutoScroll="true" />
<ext:Button runat="server" ID="IncidentErrorButton" Text="OK" >
<Click OnEvent="ErrorButton_Click" />

Aug 25, 2014, 10:39 PM
The TextArea is being submitted during the DirectEvent request, which triggers the RequestValidation.

The following link provides information on how to disable RequestValidation:


Aug 25, 2014, 11:30 PM
Is there any way we can HTML-encode Direct Events somehow to comply with the .NET security? Also I think this is a better link as it explains how to disable Request Validation in .NET 4 (http://msdn.microsoft.com/en-us/library/hh882339(v=vs.110).aspx) or later :-)

Thank you,

Aug 26, 2014, 12:29 AM
Well, you could get the TextArea value, then encode it and set it back, in the .Before handler of the Button.