I'm creating a new site in Umbraco 10. One of the pages contains 10 fields which are filled in by the admin of the site.
Once these details are displayed to the end user in a page, I have 2 more text fields which have been added to the view (not part of the original 10 fields), along with a button which when clicked should allow me to pick up all these fields and values and carry out other tasks.
I won't list the 'other tasks' unless someone needs to know but if I can get the current pages values I'll know what to do.
I have a SurfaceController. I added a @BeginUmbracoForm clause to the cshtml which contains this button and upon clicking the button it hits my controller action.
The controller is declared
Public void DoOneThing(MyDocumentType obj)
But no data is present in obj.
How could I set up the view to bring in the 10 fields plus any additional ones not part of the document type?
How to pass object to surface Controller?
I'm creating a new site in Umbraco 10. One of the pages contains 10 fields which are filled in by the admin of the site.
Once these details are displayed to the end user in a page, I have 2 more text fields which have been added to the view (not part of the original 10 fields), along with a button which when clicked should allow me to pick up all these fields and values and carry out other tasks.
I won't list the 'other tasks' unless someone needs to know but if I can get the current pages values I'll know what to do.
I have a SurfaceController. I added a @BeginUmbracoForm clause to the cshtml which contains this button and upon clicking the button it hits my controller action.
The controller is declared
But no data is present in obj.
How could I set up the view to bring in the 10 fields plus any additional ones not part of the document type?
not 100% sure, but possibly something like
Hi
Thanks, I missed the name element in my view against the input control.
Putting that in along with your change, resolved it.
is working on a reply...