attributes - Configure access to View's SubFolders in ASP.NET MVC -
attributes - Configure access to View's SubFolders in ASP.NET MVC -
i wondering if possible next asp.net mvc 5.
i have ordercontroller , next folder's construction
view/orders/details/
i need know how can configure methods details folder?
i mean create/edit/list.
have utilize method attribute or routing , how should done?
thanks!
p.s.
i found useful link http://blogs.msdn.com/b/webdev/archive/2013/10/17/attribute-routing-in-asp-net-mvc-5.aspx
you have 2 options. can either create own code determine right view homecoming complex or can specify view need using total path. additionally if have have methods same (not sure why want that), need alter routing. alternative utilize attribute routing.
public class orderscontroller : controller { [route("createorder")] public actionresult create(order order) { //snip homecoming view("~/views/orders/details/create.cshtml"); } [route("createorderdetails")] public actionresult create(orderdetails orderdetails) { //snip homecoming view("~/views/orders/details/create.cshtml"); } } asp.net-mvc attributes asp.net-mvc-5 asp.net-mvc-routing project-structure
Comments
Post a Comment