Its been a while since I made some more advance stuff in Umbraco, I mostly create simple pages but now Im back to making a new application for handling bookings.
Im not so familiar yet with the mvc way of connecting to custom tables in Umbraco 7 but I found this article:
Yes, this article is the right way to start using custom data tables in Umbraco projects.
Also it would be great to read about WepApi controllers, they are convenient for CRUD operations.
Ive managed to create a form and saving the result to a custom table using SurfaceController and so on.
But Im not really sure how to solve one thing:
I have a model with something like this:
public class BookingFormViewModel
{
public int CampId { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string Address { get; set; }
[Required]
public string Postal { get; set; }
[Required]
public string City { get; set; } }
But now I also want to list all available "camps" that is sub nodes to the current node and let the user select one camp. I want to make a table with a radiobutton so that I can display info about each camp. The problem is that i dont know how to send the selected radiobutton to my surfaceController..? I would like to populate the models CampId with the selected camp.
var currentNode = UmbracoContext.Current.PublishedContentRequest.PublishedContent;
Working with custom database tables in Umbraco 7
Hi all!
Its been a while since I made some more advance stuff in Umbraco, I mostly create simple pages but now Im back to making a new application for handling bookings.
Im not so familiar yet with the mvc way of connecting to custom tables in Umbraco 7 but I found this article:
http://creativewebspecialist.co.uk/2013/07/16/umbraco-petapoco-to-store-blog-comments/
Is that "the way to go"? Im saving data from a form to a custom created table and I need to create, edit and delete as always.
Any other hints on best practice?
Hi Froad,
Yes, this article is the right way to start using custom data tables in Umbraco projects. Also it would be great to read about WepApi controllers, they are convenient for CRUD operations.
https://our.umbraco.org/documentation/Reference/WebApi/
Thanks, Alex
A follow up questions to the above:
Ive managed to create a form and saving the result to a custom table using SurfaceController and so on.
But Im not really sure how to solve one thing:
I have a model with something like this:
And a view loing like this:
But now I also want to list all available "camps" that is sub nodes to the current node and let the user select one camp. I want to make a table with a radiobutton so that I can display info about each camp. The problem is that i dont know how to send the selected radiobutton to my surfaceController..? I would like to populate the models CampId with the selected camp.
is working on a reply...