Dear support team,
I have a grid which registeres an error event. When the model validation fails, the event is correctly triggered and I get a messagebox.
Next i tried to insert a dummy javascript (<script>alert('aaa')</script>) into the textbox.
MVC reacts on it with an error 500 ('a potential malicious request was detected')
However the onError event function is not triggered now.
Any ideas what I've done wrong here?
btw my version is 2014.Q2
A second issue is, that I don't get a bootbox window. Instead I get a standard message box. Perhaps you have a clue on that too.
thank you,
Chris
I have a grid which registeres an error event. When the model validation fails, the event is correctly triggered and I get a messagebox.
Next i tried to insert a dummy javascript (<script>alert('aaa')</script>) into the textbox.
MVC reacts on it with an error 500 ('a potential malicious request was detected')
However the onError event function is not triggered now.
@(Html.Kendo().Grid<MyViewModel>()
.Name(
"kendoGrid"
)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => { model.Id(i => i.Id); })
.Create(create => create.Action(
"_Create"
,
"Controller"
))
.Read(read => read.Action(
"_Index"
,
"Controller"
))
.Update(update => update.Action(
"_Update"
,
"Controller"
))
.Destroy(destroy => destroy.Action(
"_Delete"
,
"Controller"
))
.Events(events => events.Error(
"onError"
)) // <----------- Register Error Event
)
.ToolBar(toolbar => toolbar.Create().Text(
"New"
))
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Columns(column => {
column.Bound(i => i.Name);
column.Command(cmd => {
cmd.Destroy();
cmd.Edit();
});
})
)
<script type=
"text/javascript"
>
function
onError(e) {
alert("test");
if
(e.errors) {
var
message =
"The folowing errors occured:\n"
;
$.each(e.errors,
function
(key, value) {
if
(value.errors) {
message += value.errors.join(
"\n"
);
}
});
bootbox.alert(message);
}
else
{
bootbox.alert(
"An unknown error occured"
);
}
}
</script>
Any ideas what I've done wrong here?
btw my version is 2014.Q2
A second issue is, that I don't get a bootbox window. Instead I get a standard message box. Perhaps you have a clue on that too.
thank you,
Chris