private void HandleValidExc(ValidationException exc) { var newRow = new TableRow(); Rows.Add(newRow); var newCell = new TableCell() { Text = exc.MessageHeader, ColumnSpan = 2 }; newCell.Attributes["id"] = ClientID + "_Header"; newCell.Attributes[EasyTestTagHelper.TestField] = "ErrorInfo"; newCell.Attributes[EasyTestTagHelper.TestControlClassName] = JSLabelTestControl.ClassName; newRow.Cells.Add(newCell); foreach (var validRes in new[] { ValidationResultType.Error, ValidationResultType.Warning, ValidationResultType.Information }) { string errorMessage = exc.GetMessages(validRes); if (!string.IsNullOrEmpty(errorMessage)) { AddError(element, validRes.ToString(), errorMessage, "Validation" + validRes); } } if (exc.Result.ValidationOutcome == ValidationOutcome.Warning) { TableRow row2 = new TableRow(); row2.Cells.Add(new TableCell()); var cell = new TableCell(); cell.ColumnSpan = 2; row2.Cells.Add(cell); Rows.Add(row2); cell.Controls.Add(checkIgnore); checkIgnore.Visible = true; checkIgnore.Text = CaptionHelper.GetLocalizedText("Texts", "IgnoreWarning"); checkIgnore.Attributes[EasyTestTagHelper.TestField] = checkIgnore.Text; checkIgnore.Attributes[EasyTestTagHelper.TestControlClassName] = JSASPxCheckBoxTestControl.ClassName; } }
private void HandleValidExc(ValidationException exc) { var newRow = new TableRow(); Rows.Add(newRow); var newCell = new TableCell() { Text = exc.MessageHeader, ColumnSpan = 2 }; newCell.Attributes["id"] = ClientID + "_Header"; newCell.Attributes[EasyTestTagHelper.TestField] = "ErrorInfo"; newCell.Attributes[EasyTestTagHelper.TestControlClassName] = JSLabelTestControl.ClassName; newRow.Cells.Add(newCell); foreach (var validRes in new[] { ValidationResultType.Error, ValidationResultType.Warning, ValidationResultType.Information }) { string errorMessage = exc.GetMessages(validRes); if (!string.IsNullOrEmpty(errorMessage)) { AddError(element, validRes.ToString(), errorMessage, "Validation" + validRes); } } if (exc.Result.ValidationOutcome == ValidationOutcome.Warning) { TableRow row2 = new TableRow(); row2.Cells.Add(new TableCell()); var cell = new TableCell(); cell.ColumnSpan = 2; row2.Cells.Add(cell); Rows.Add(row2); cell.Controls.Add(checkIgnore); checkIgnore.Visible = true; checkIgnore.Text = CaptionHelper.GetLocalizedText("Texts", "IgnoreWarning"); checkIgnore.Attributes[EasyTestTagHelper.TestField] = checkIgnore.Text; checkIgnore.Attributes[EasyTestTagHelper.TestControlClassName] = JSASPxCheckBoxTestControl.ClassName; } }