1
votes

I have two webparts on a Project Details Page, webpart #1 is a default form webpart, webpart#2 is a custom webpart with custom form.

Now when I click on "Save" in ribbon it fires the save event for Web Part 1.

My question: Is there a way to capture the save ribbon event, so I can trigger the save event of my custom web part ?

Thank you,

2

2 Answers

2
votes

We can specify the OnSaveHandler at runtime as follows,

SPContext.Current.FormContext.OnSaveHandler = btnSave_Click;
0
votes

You can try to achieve this using javascript. You need to add your custom script block with function PreSaveAction. Something like this:

<script>
function PreSaveAction(){
//Do your stuff
}
<script>

Please refer to this post.