[RESOLVED]MVC Routing level

HI All,

         MVC Routing is controller level action or model level action

I think 

MVC Routing is controller level action

Routing is not tied to MVC. You can use it WebForms, Web API and SignalR.

Hi binumon03,

Thanks for your post.

According to your description,

binumon03

MVC Routing is controller level action or model level action

ASP.NET MVC5 supports a new type of routing, called attribute routing. In this routing, attributes are used to define routes. Attribute routing provides you more control over the URIs by defining routes directly on actions and controllers in your ASP.NET
MVC application .

More information,you can refer to the following link:

#Understanding Attribute Routing in ASP.NET MVC

http://www.dotnet-tricks.com/Tutorial/mvc/4PK4010514-Understanding-Attribute-Routing-in-ASP.NET-MVC.html

Hope this can be helpful.

Best Regards,

Eileen

Hi Eileen,

                 Thanks for your reply. I using MVC 4 only. In MVC 4 Routing happening controller level or model level?

Hi binumon03,

Thanks for your reply.

in mvc4 ,routing was set in RouteConfig.cs.

  • When the request’s URL matches any of the registered route patterns in the route table then the routing engine forwards the request to the appropriate handler for that request. Thereafter the route is processed and gets a view  on the UI.
  • When the request’s URL does not match any of the registered route patterns then the routing engine indicates that it  could not determine how to handle the request by returning a 404 HTTP status code.

More information:

#Routing in MVC

http://www.codeproject.com/Articles/648707/Routing-in-MVC

Hope this can be helpful.

Best Regards,

Eileen

Leave a Reply