.NET server side cancel some events
.NET server side cancel some events

I'm using the .NET Editor. I'm trying to only allow users to read and update provided records and don't want them to create or delete. I know on the client side I could do a few things:
(1) not provide the Create and Remove buttons;
(2) Listen to editor.on( 'preCreate/preRemove' and return false to cancel them;
Is there any way I can cancel the two events on the server side?
editor.PreCreate += (sender, e) => {
......
};
Thanks!
This discussion has been closed.
Replies
I ended up with using the request object directly:
if(request.Form["action"].Count > 0)
that means the user is trying to do a create/edit/remove; I can get the action from request.Form["action"][0], and then I just return Json(Ok("")).
I'm still wondering if there is another way.
Hi,
Yes indeed you can cancel the
pre
events triggered by our .NET libraries. The docs for that are available here.should do it.
Regards,
Allan