Reading form values of a page when submitted

Ashutosh Pandey asked on January 19, 2020 18:56

I just figured out that we can use global events to do something when some event like page save occurs.

I'm working on:

DocumentEvents.Insert.After += Document_Insert_After; DocumentEvents.Update.After += Document_Update_After;

I want to read the form data submitted from the page. How can I do this when page is created and updated?

Can I read something from e.Node where e is the reference of DocumentEventArgs?


Correct Answer

Ashutosh Pandey answered on January 23, 2020 04:35

Thanks Juraj, I was able to read values like this:

String name = e.Node.GetStringValue("name", null);

0 votesVote for this answer Unmark Correct answer

Recent Answers

Juraj Ondrus answered on January 20, 2020 08:50

As you can see in the document event handler reference, the DocumentEventArgs contain the Node object data - so using these you can get the values of the properties and fields. For example:

var doc = e.Node;   
string DocName = doc.DocumentName;
3 votesVote for this answer Mark as a Correct answer

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