Page with button running C# code

Topics: Customizing Orchard, General, Writing modules
Jul 4 at 10:05 AM
Hello, I am trying to make a very simple page in Orchard, only with textarea and button and after clicking the button I would like to run some my C# code and parse the text from textarea (and then create specific data structure - that is already working for me fine using contentparts).

I have prepared Parsing service and service for inserting that parsed data contentparts into database (via contentmanager) and that already works fine.

The problem is, that I have no idea, how can I connect the page (one specific button) with my code and use the textarea content as string?

Tried to google/browse some tutorials/stackoverflows, but either I missed it or just somehow could not find that (may be I am bad at googling :D ).

Thank for your help.
Jul 4 at 3:57 PM
A typical implementation is to wrap your textarea and button with a form. You point this form's action to a controller provided by your module, which executes the desired code.
Marked as answer by satikcz on 7/11/2016 at 7:37 AM