Extending Kentico form

Zakhar Z asked on May 30, 2014 06:46

Hi guys,

I have a 'contact us' form created in Kentico and I need to add a 'subscribe to newsletter' checkbox and if the checkbox is checked on submission do a method call to subscribe the user. Is it possible to create a handler for a Kentico form or do I have to create a new form from scratch myself?

Thank you, Zakhar.

Correct Answer

Brenden Kehren answered on May 30, 2014 07:24

There are a few ways you can go about this:

*Extend the current BizForm webpart and in the OnAfterSave event, perform your newsletter subscription via the API * Use a global handler. Documentation for v7 and Documentation for v8

I like the global handler specifically because it's not a "one off" scenario, offers a single place for other events to be handled, and gives the developer(s) a single place to go to manage code vs. messing around with creating new webparts and such.

1 votesVote for this answer Unmark Correct answer

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