Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 07, 2013 06:26 AM by mani2009it
Jan 05, 2013 02:45 PM|LINK
I have a Dropdown (autopostback enabled to perform some action) box inside an Update Panel. On the same page, I have a text box control which is outside the Update Panel. & there is no impact of Dropdown's autopostback on multiline Textbox.
Now, If user enters any text, which contains HTML tag, in Textbox & try to change the data of dropdown (means autopostback will be done), Asynchronous Post back fires an exception due to Textbox HTML data.
How can I stop this exception? there is no impact of dropdown's autopost back on Textbox & I am not sending textbox data to server while updating the update panel. I am checking the HTML text while I am submitting the page data. Drop down is populatng some
other controls inside update panel.
Jan 05, 2013 10:35 PM|LINK
the update panel works by posting all the form data (via ajax), and running the full page lifecycle on the server, so you are sending the textbox data. when the sever completes the request rather than returning the full html, it returns the xml payload expected
Jan 07, 2013 03:19 AM|LINK
In the page label set EnableEventValidation to false.
Jan 07, 2013 06:26 AM|LINK
As bruce said, your textbox data will be sent to server on post operation. Asp.Net by default throws an runtime exception if your page input control contains html markups to avoid CSS attack. You can either block users from entering html markups or set
the "ValidateRequest" property of page directive to false.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CS.aspx.cs" Inherits="CS"