Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to make an endpoint that collects a some form data from the frontend. As I get it I should make a surface controller.
I am new to both C# MVC and Umbraco Surface Controllers. I usually place my C# code in the App_Data folder.
But is that the same place to put Surface Controllers? And how do I organize the different files? I am basically looking for a Hello World example and I can´t seem to find it with Google.
This doesn´t help me: https://our.umbraco.com/documentation/reference/routing/surface-controllers just
As always - Paul Seal is to the rescue.
He has an nice video and step by step guide.
The simple answer is put your surface controller in the App_data folder and your partials and views in the Views folder.
The confusing thing in .NET is the mixture of compiled code and views (which are sort of still compiled but on use). Putting code into App_data means you avoid having to create dlls / build out solutions but it is just compiled when the app starts up instead.
You really need to be moving to using Visual Studio and compiling if things start getting complicated - if you're wondering how to organise your code in App_data you're probably ready! Plus the benefits of being able to debug and see what's happen make it worth the step. I'm sure Paul has a video for that in the early steps of his series.
If you are new in c# mvc and umbraco you must read the following docs respectively.
Thanks, Steve and DKMJ! :)
I have marked Steves post as answer, not that DKMJ´s isn´t one too. But Steve was a direct answer to my question and DKMJ´s was broader and go for the day when I get the time to get to learn the stuff the really right way. :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted