Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > BizForm & OnBeforeSave View modes: 
User avatar
Member
Member
tspring-allegra - 10/5/2010 5:48:44 AM
   
BizForm & OnBeforeSave
Hi

I'm trying to create a custom bizform webpart so I can add some extra validation to some fields. I've cloned the Bizform webpart and edited the code, but for some reason I cant get the OnBeforeSave event to work.

Even before writing any validation code, surely if I add the following code, no matter what I do when the bizform is submitted it shouldn't save:

protected void viewBiz_OnBeforeSave()
{
viewBiz.BasicForm.StopProcessing = true;
}

Am I correct in thinking this, or have I done something wrong?

Either way, with the code above added, the bizform still saves. How can I stop the form from saving?

I'm using Kentico 4.1.

Thanks,
Tim

User avatar
Member
Member
eagleag - 10/5/2010 7:53:55 AM
   
RE:BizForm & OnBeforeSave
Hi

try this:


protected void viewBiz_OnAfterValidate()
{
viewBiz.BasicForm.StopProcessing = true;
}

and of course add -> OnOnAfterValidate="viewBiz_OnAfterValidate" to bizfrom control on ascx.

Hope this helps :)

User avatar
Member
Member
tspring-allegra - 10/5/2010 10:14:50 AM
   
RE:BizForm & OnBeforeSave
Thanks for the help, it worked perfectly :)