Form + WebPart not calling viewBiz_OnAfterSave

Craig Hazard asked on September 24, 2014 10:49

I've been trying to make custom behavior for a Form after it has been submitted and I have confirmed that the viewBiz_OnAfterSave is being attached to the viewBiz.OnAfterSave event, but after hitting submit the event isn't triggering. I have confirmed this by putting a label on the page and modifying it inside the event.

Here is my WebPart: <%@ Control Language="C#" AutoEventWireup="true" Inherits="CMSWebParts_BizForms_stripepayment" Codebehind="~/CMSWebParts/BizForms/stripepayment.ascx.cs" %>

<cms:BizForm ID="viewBiz" runat="server" IsLiveSite="true" FormName="ApplicationForm" />
<asp:Label ID="lblConfirmationMessage" runat="server"></asp:Label>

And inside of the code behind it is getting hooked up

protected override void OnLoad(EventArgs e)
{
    viewBiz.OnAfterSave += viewBiz_OnAfterSave;
    base.OnLoad(e);
}

And i confirmed that the event is hooked up by checking in the debugger.

I have tried multiple settings for the "After the form is submitted:" on the form control, but I have no been able to get the after save event to trigger. I can confirm the data is being saved every time I press the submit button.

Do you have any ideas?

Correct Answer

Craig Hazard answered on September 24, 2014 11:11

Solved it, Wasn't setting the BizFormName property on the Web Part that was in the page

0 votesVote for this answer Unmark Correct answer

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