0

I want to respond to the insertion of data into a Sharepoint list (which will be done from the client/JavaScript (*.asxc file) in the code-behind/C#.

Is there a way to do that? Can I hook up an "OnListUpdated" handler in the Sharepoint Web Part's code-behind (*.ascx.cs) file?

I want to let the user just select one button, which will populate the list (from the client) and then immediately thereafter generate a PDF file (from the server).

  • 1
    Why don't you insert data from server side code as well? Other way I can think of is you take a server-side button and call OnClientClick as well as OnClick.. first client-side code will be executed than server-side code will be executed – Arsalan Adam Khatri Sep 18 '15 at 21:36
  • The client-side values are nearly impossible to retrieve from the server-side code. I have two viable options AFAICT: create the controls/elements in C# (kind of a pain, especially since I've already got the HTML written) OR insert the data from the client-side, which requires an AJAX call. – B. Clay Shannon Sep 18 '15 at 22:05
2

You'll need to look into event handlers for this. You're probably looking for the ItemUpdated event.

How to create an event receiver

Also

MSDN ItemUpdated event

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.