How would i include my own C# code in an orchard page?

Topics: General
Aug 1, 2011 at 8:40 PM

I would like to add some basic functionality to some orchard generated pages. For example, a contact form (i know there's one i can download from the gallery). What i wanted to know is if it's possible for me to let the end user edit this page while still being able to use my own C# code to handle the functionality.

If this is do-able, can someone just point me in the right direction. 

http://orchardproject.net/docs/Building-a-hello-world-module.ashx

I did look that over - but will that allow the end user to edit the hello-world page?

Thanks

Coordinator
Aug 1, 2011 at 11:12 PM

Can you give more details about what exactly you're trying to do?

Aug 2, 2011 at 12:43 AM

Basically, i want to know how i can have a page that is editable by the user, but i can still have some of my own C# code behind the page. I used the contact form as an example. But it could be anything really. Maybe a page with a datagrid on it or a form to update a database table etc etc.

To be clear - i dont want the user to be able to edit the C# code. But i do want them to be able to edit the text/styling etc on the page as much as possible. I'm just not entirely clear on how i go about doing something like that. if there's a demo/doc explaining this, just point me to the link and I'll follow along.

Thanks

Coordinator
Aug 2, 2011 at 1:31 AM

This sounds like the scenario for pretty much anything you would do with Orchard :) The hello world example is the most basic you could find and it doesn't begin to cover what's possible. You should probably look next at content types, drivers and templates. These may be good places to look, as well as the source code from some modules on the gallery that seem to do something close to what you want:

http://orchardproject.net/docs/, Extending Orchard section.

Aug 2, 2011 at 1:41 AM

ok, thanks. I'll give those sections a look over.