1

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,

4

2 回答 2

2

We can specify the OnSaveHandler at runtime as follows,

SPContext.Current.FormContext.OnSaveHandler = btnSave_Click;
于 2014-03-06T07:36:58.777 回答
0

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.

于 2013-11-08T16:48:03.313 回答