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

  1. #1

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

    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)
            {
                this.IncidentErrorWindow.Close();
                this.IncidentTabPanel.Enable();
            }

    <ext:Window runat="server" ID="IncidentErrorWindow" Title="Error Message"  Hidden="true" Width="330"  Icon="cancel" Closable="false">
                        <Items>
                            <ext:FormPanel runat="server" Border="False" Padding="5" DefaultAnchor="100%" BodyStyle="background-color: #E0E0E0;"  ButtonAlign="Center">
                                <Items>
                                    <ext:TextArea runat="server" ID="IncidentErrorMessage" MinHeight="120" ReadOnly="true" Margin="5" AutoScroll="true" />
                                </Items>
                                <Buttons>
                                    <ext:Button runat="server" ID="IncidentErrorButton" Text="OK" >
                                        <DirectEvents>
                                            <Click OnEvent="ErrorButton_Click" />
                                        </DirectEvents>
                                    </ext:Button>
                                </Buttons>
                            </ext:FormPanel>
                        </Items>
                    </ext:Window>
    Last edited by Daniil; Sep 02, 2014 at 1:12 PM. Reason: [CLOSED]
  2. #2
    The TextArea is being submitted during the DirectEvent request, which triggers the RequestValidation.

    The following link provides information on how to disable RequestValidation:

    http://www.asp.net/whitepapers/request-validation
    Geoffrey McGill
    Founder
  3. #3
    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 or later :-)

    Thank you,
    Aaron
  4. #4
    Well, you could get the TextArea value, then encode it and set it back, in the .Before handler of the Button.
    Last edited by Daniil; Aug 26, 2014 at 5:39 AM.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] When using Form Validation, I get the error below:
    By Fahd in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 23, 2012, 3:51 PM
  2. viewstate error after closing iframe window
    By pstorch in forum 1.x Help
    Replies: 0
    Last Post: Mar 01, 2012, 10:32 AM
  3. Replies: 1
    Last Post: Nov 11, 2011, 2:48 PM
  4. Replies: 3
    Last Post: Jun 28, 2010, 5:14 PM
  5. Error with Store when closing window
    By fabiomarcos in forum 1.x Help
    Replies: 7
    Last Post: Jan 30, 2009, 3:39 PM

Posting Permissions