What is the best approach to have a kind of edit form for the site visiter with umbraco?
A very simple example is an application (Website) that has 2 pages.
First page: a list of countries.
So in umbraco i created a document type with template called "List" there is a Surface controller that gets called when the page is visited. That controller gets a list of countries (lets say from a list of objects)
public class Country
{
public Guid Id { get; set; }
public string Name { get; set; }
public Country(string name)
{
Id = new Guid(); //Or something likewise... whatever
Name = name;
}
}
List<Country> countries = new List<Country>();
countries.add(new Country("UK"));
countries.add(new Country("US"));
countries.add(new Country("France"));
countries.add(new Country("Belgium"));
The surface controllers gets this object back and renders a list of these countries in its razor view, next to each country there is a button called "Change this country"
Back in Umbraco, i also have a second document type with template called "Edit" This should be used for some Editing mechanics of that Country...
I would also prefer to have a routing like this
http(s)://localhost:12345/Edit/2354
instead of
http(s)://localhost:12345/Edit?id=2354
What is the best thing to do that? I have tried it with surface controllers, but i can't post back I have tried with Route Hijacking and completely hijacked the MVC route.
I have also searched many hours on the internet. but i cant find a good solution for this very simple problem. at least in my opinion this problem is very simple :) but i just can't get my head around it.
I hope someone is around that can solve this.