Contents tagged with ASP.NET MVC . Routing

  • Using Alternative Routes, How?

    Last week on the forums, I saw some posts about overlapping routes. “Ideally I would like to be able to tell the routing to look for a controller named X, if it exists use that. If it doesn't exist, redirect to Y controller and pass in X as a parameter.” said the writer of the post. Such situation happens in case we want to implement dynamic routes. Something like the following routes:




    defaults= New { …

  • ASP.NET. Several Optional Parameters in body of Urls 2

    In this post, I describe the implementation detail of the Custom Routing. It extends the capabilities of the ASP.NET MVC routing in such a way that developers can define optional parameters in the Urls paths. The library detects which parameters are provided and which ones are missed in each request or url. In other words, we expects from the library to detect the route values as follows:

    http://[DomainName]/austria/tablets/samsung {Country = austria, category=tablets, brand = samsung} http:// …

  • ASP.NET. Several Optional Parameters in body of Urls 1

    Routing in the last versions of ASP.NET makes a great progress. Compare to earlier versions of ASP.NET, new Routing features are magical. Especially in ASP.NET MVC, It completely separates the routing from Controllers and makes the routing completely loosely coupled from the functional codes of Controllers

    But there are still some deficiencies. One of them that annoys me in several projects, is having multiple optional parameters in the body of a Url. Something like the following route. …