Replies: 3 comments 9 replies
-
Maybe list what you would like to accomplish here so we know the limitation.
|
Beta Was this translation helpful? Give feedback.
-
Creating controller in orchard module is not different than creating controller in asp.net without orchard.
Check sample code in Demo module |
Beta Was this translation helpful? Give feedback.
-
Form in razor page doesn't directly tied to your POST controller action. It's magic of MVC model binding. You can create widget form using OC forms module and have the data posted to your controller POST action. As long as you define your model on controller action that MVC model binding understand, you will see your model properties get populated. You can add custom validation on your model. |
Beta Was this translation helpful? Give feedback.
-
It would be nice to have documentation, or an example, for how to do the following:
Part 1 (easy enough): a widget that contains a form written in Razor. (Orchard Core's own Forms module is too inflexible.)
Part 2 (the part I can't figure out): a controller implemented in C#, that would check the submitted form data and if there's a mistake, can send the user back to the original page with the form contents still intact, so the user can correct the mistake and try again. (Not that difficult if there's no need to remember the form contents, but there is, and I have no idea how to get the form data back to the page.)
Our website has been OC-based for close to a year and I still don't know how to do it. I once tried to look at the source code of the Forms module to see how it does it, but it was a total mess and I couldn't follow it.
Beta Was this translation helpful? Give feedback.
All reactions