Bizform custom post method

Conor Dunk asked on September 28, 2016 15:46

Hi,

When a user submits a bizform I need to call a custom method, is this possible within Kentico 9?

Thank you, Conor

Recent Answers


Matthew Sandstrom answered on September 28, 2016 16:02 (last edited on September 28, 2016 16:04)

Yes, you can register a global event handler for bizform insert and call your method there.

Here's the idea: https://docs.kentico.com/display/K9/Handling+global+events And here are the events themselves: https://docs.kentico.com/display/K9/Reference+-+Global+system+events#Reference-Globalsystemevents-BizFormItemEvents

1 votesVote for this answer Mark as a Correct answer

Jake Kula answered on October 7, 2016 02:12

Hi, you can also clone the Biz Form web part and define before-save and/or after-save methods to handle this. Then, in your cloned web part .ascx control:

In .ascx front-end code:

<cms:BizForm ID="viewBiz" runat="server" OnOnBeforeSave="viewBiz_OnBeforeSave" OnOnAfterSave="viewBiz_OnAfterSave" IsLiveSite="true" />

In .ascx.cs code-behind:

private void viewBiz_OnBeforeSave(object sender, EventArgs e)
{
    //Do something
}

private void viewBiz_OnAfterSave(object sender, EventArgs e)
{
    //Do something
}
0 votesVote for this answer Mark as a Correct answer

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