views:

54

answers:

1

If I am listing child items of a parent in an asp.net mvc app, is there a best practice to how the url structure should be formed?

Example:

 1. http://app/parent/<parentID>/children
 2. http://app/parent/children/<parentID>

I'm personally more inclined to choose option 1, but am wondering if there is a particular way that most mvc apps go with.

Also, assuming option 1, how would one use the Html.ActionLink method in the parent view to build up the link? I can build the link for option 2 easy enough using:

<%=Html.ActionLink("Child List", "Children", new { id = Model.ID })%>
+1  A: 

Not sure about best practices but I will opt for option 1 too.

Perhaps "parents" with an 's':
http://app/parents/&lt;parentID&gt;/children

Option 2 just doesn't seem right/logical to me.

o.k.w