To strengthen data security of our data editor components, DevExpress ASP.NET WebForms and Bootstrap Data Editors now validate their values on the server side even if the user does not modify the editor values on the client side.
Starting with the v19.2.2, the following properties are involved in data editors validation:
ASP.NET WebForms:
ASPxTextBox
ASPxSpinEdit
ASPxCalendar
ASPxDateEdit
ASPxListBox
- ASPxListBox.DataSecurityMode (if set to DataSecurityMode.Strict)
ASPxComboBox
- ASPxAutoCompleteBoxBase.DataSecurityMode (if set to DataSecurityMode.Strict)
- ASPxTextBoxBase.MaxLength
ASPxTokenBox
- ASPxAutoCompleteBoxBase.DataSecurityMode (if set to DataSecurityMode.Strict)
ASP.NET Bootstrap:
BootstrapTextBox
BootstrapSpinEdit
BootstrapCalendar
BootstrapDateEdit
BootstrapListBox, BootstrapComboBox, BootstrapTagBox
An editor does not check whether its edit value has a match in the item list (DataSecurityMode is set to Strict).
BootstrapComboBox
Workaround
This change may affect your existing application.
To revert all data editors in a project to the previous behavior, set the ASPxWebControl.BackwardCompatibility.DataEditorsEnableValidationForNotModifiedValues static property to False.
Global.asax:
C#void Application_Start(object sender, EventArgs e) {
ASPxWebControl.BackwardCompatibility.DataEditorsEnableValidationForNotModifiedValues = false;
}
Visual BasicPrivate Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
ASPxWebControl.BackwardCompatibility.DataEditorsEnableValidationForNotModifiedValues = False
End Sub
Another way to customize the behavior of individual data editors in your application is to modify any of the validation settings mentioned above so that they meet your requirements.
As for the DevExpress ASP.NET Bootstrap ComboBox, ListBox and TagBox components, use the following code to allow adding new list items on the client and then synchronizing modifications with the server item collection.
C#// Bootstrap List Box
((ASPxListBox)ListBox).DataSecurityMode = DevExpress.Web.DataSecurityMode.Default;
// Bootstrap Combo Box
((ASPxComboBox)ComboBox).DataSecurityMode = DevExpress.Web.DataSecurityMode.Default;
// Bootstrap Combo Box Column
var comboBoxColumn = (DevExpress.Web.Bootstrap.BootstrapGridViewComboBoxColumn)TestGrid.DataColumns["A"];
var propertiesComboBox = (ComboBoxProperties)comboBoxColumn.PropertiesComboBox;
propertiesComboBox.DataSecurityMode = DevExpress.Web.DataSecurityMode.Default;
// Bootstrap Tag Box
((ASPxTokenBox)TagBox).DataSecurityMode = DevExpress.Web.DataSecurityMode.Default;
// Bootstrap Tag Box column
var tagBoxColumn = (DevExpress.Web.Bootstrap.BootstrapGridViewTagBoxColumn)TestGrid.DataColumns["B"];
var propertiesTagBox = (TokenBoxProperties)tagBoxColumn.PropertiesTagBox;
propertiesTagBox.DataSecurityMode = DevExpress.Web.DataSecurityMode.Default;
Visual Basic' Bootstrap List Box
(CType(ListBox, ASPxListBox)).DataSecurityMode = DevExpress.Web.DataSecurityMode.[Default]
' Bootstrap Combo Box
(CType(ComboBox, ASPxComboBox)).DataSecurityMode = DevExpress.Web.DataSecurityMode.[Default]
' Bootstrap Combo Box Column
Dim comboBoxColumn = CType(TestGrid.DataColumns("A"), DevExpress.Web.Bootstrap.BootstrapGridViewComboBoxColumn)
Dim propertiesComboBox = CType(comboBoxColumn.PropertiesComboBox, ComboBoxProperties)
propertiesComboBox.DataSecurityMode = DevExpress.Web.DataSecurityMode.[Default]
' Bootstrap Tag Box
(CType(TagBox, ASPxTokenBox)).DataSecurityMode = DevExpress.Web.DataSecurityMode.[Default]
' Bootstrap Tag Box Column
Dim tagBoxColumn = CType(TestGrid.DataColumns("B"), DevExpress.Web.Bootstrap.BootstrapGridViewTagBoxColumn)
Dim propertiesTagBox = CType(tagBoxColumn.PropertiesTagBox, TokenBoxProperties)
propertiesTagBox.DataSecurityMode = DevExpress.Web.DataSecurityMode.[Default]