How can I make this Route (ASP.Net MVC2) ?
Posted
by Felipe
on Stack Overflow
See other posts from Stack Overflow
or by Felipe
Published on 2010-04-11T17:08:02Z
Indexed on
2010/04/11
17:13 UTC
Read the original article
Hit count: 467
Hi All, I'm begginer in asp.net mvc and I have some doutbs about routes.
Im' developing a system to manage documents and I need make an URL like this:
routes.MapRoute("Documentos",
"{controller}/{documentType}/{documento}/{action}/{id}",
new
{
controller = "Home",
documentType = "",
documento = "",
action = "Index",
id = UrlParameter.Optional
});
and the app working an URL like theses:
"Document/Administrative/Contract" - (Index action by default to list documents of type 'Contract') "Document/Administrative/Contract/New" - (new action in controller) "Document/Administrative/Contract/10" - (detail action in controller) "Document/Administrative/Contract/Edit/10" - (edit action in controller)
Document would be a Controller, and Administrative would be just a description in url to identify that documents of 'Contract' is Administrative...
So, My doubts is about my controllers and actions, How should be the signature of the methods of controller ? Need I make an Area called Documents to do this more easy ?
PS: Sorry for my english!
Thanks a lot, Cheers!
Felipe
© Stack Overflow or respective owner