custom event handler issue after Kentico 8 upgrade

Wayne Yuan asked on February 3, 2016 02:35

We have following custom event handler in Kentico 7, CMSRequestEvents.Begin.Before += new EventHandler

Recent Answers


Brenden Kehren answered on February 3, 2016 02:47

So what's your issue then?

1 votesVote for this answer Mark as a Correct answer

Wayne Yuan answered on February 3, 2016 02:56

The issue we found is that our web site can't capture the 401 error from Ajax call. I have the following code.

$.ajaxSetup({ beforeSend: function (xhr) { var token = $('[name=__RequestVerificationToken]').val(); xhr.setRequestHeader('__RequestVerificationToken', token); }, statusCode: { 401: function () { -------------------------- } }

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 3, 2016 15:19 (last edited on February 3, 2016 15:27)

Still not seeing the link or the problem with your initial code and your second answer. Maybe a full question with details would be better to provide you an answer to.

The equivalent to the method you mention above in v8.x or v9.x would be something like:

RequestEvents.Begin.Execute += new EventHandler<EventArgs>(YourMethodName);

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.