PDA

View Full Version : HtmlEditor potentially dangerous values.



extjs
7 Aug 2009, 2:27 AM
Hi all,
I have a htmleditor inside a form.
When i post this form to the ASP.NET server it intercept html tags <> and potentially dangerous character such as " ' " and it returns an error.
Is there a method to encode the form data in extJS ?



From MSDN :
ASP.NET examines input from the browser for dangerous values.
Request validation is performed by comparing all input data to a list of potentially dangerous values. If a match occurs, ASP.NET raises an HttpRequestValidationException (http://msdn.microsoft.com/en-us/library/system.web.httprequestvalidationexception.aspx).
Here is the code :



var htmlEditorPanel = new Ext.FormPanel({
title: 'Summary',
width: 400,
height: 300,
frame: true,
layout: 'fit',
items: {
id: 'SummaryEditor',
xtype: 'htmleditor',
enableColors: false,
enableAlignments: false
}
});

htmlEditorPanel.addButton(
'Save',
function() {
var MyhtmlEditor = Ext.getCmp('SummaryEditor');
MyhtmlEditor.syncValue();

htmlEditorPanel.getForm().submit({
method: 'POST',
waitTitle: 'Connecting',
waitMsg: 'Sending data...',
url: '/Applicant/SetSummary/',
success: SuccessFn,
failure: FailureFn
});
}
);