138
votes
4answers
22k views

Is it possible to make an ASP.NET MVC route based on a subdomain?

Is it possible to have an ASP.NET MVC route that uses subdomain information to determine its route? For example: user1.domain.com goes to one place user2.domain.com goes to another? Or, can I ...
25
votes
3answers
7k views

MVC.Net Routing

Here is my scenario. For the example lets say that I need to return a list of cars based on a search criteria. I would like to have a single View to display the results since the output will be the ...
25
votes
3answers
6k views

How can I create a friendly URL in ASP.NET MVC?

How do I generate friendly URLs within the ASP.NET MVC Framework? For example, we've got a URL that looks like this: http://site/catalogue/BrowseByStyleLevel/1 The 1 is Id of the study level (Higher ...
60
votes
4answers
9k views

ASP.NET MVC ambiguous action methods

I have two action methods that are conflicting. Basically, I want to be able to get to the same view using two different routes, either by an item's ID or by the item's name and its parent's (items ...
37
votes
9answers
39k views

Custom ASP.NET MVC 404 Error Page

I am trying to make a custom HTTP 404 error page when someone types in a URL that doesn't invoke a valid action or controller in ASP.NET MVC. Instead of it displaying the generic Resource Not Found ...
9
votes
4answers
4k views

asp.net mvc complex routing for tree path

I am wondering how can I define a routing map like this: {TreePath}/{Action}{Id} TreeMap is dynamically loaded from a database like this: 'Gallery/GalleryA/SubGalleryA/View/3'
8
votes
2answers
6k views

How does a method in MVC WebApi map to an http verb?

In the 5-minute video at the following link, at the 1:10 mark, Jon Galloway says that adding a method called DeleteComment to his CommentsController controller class will by convention map ...
6
votes
4answers
4k views

MVC 2 AreaRegistration Routes Order

I noticed that in MVC 2 Preview 2, AreaRegistration is loading the routes for each area in an arbitrary order. Is there a good way to get one before the other? For example, I have two areas - "Site" ...
3
votes
2answers
3k views

ASP.Net MVC routing legacy URLs passing querystring Ids to controller actions

We're currently running on IIS6, but hoping to move to IIS 7 soon. We're moving an existing web forms site over to ASP.Net MVC. We have quite a few legacy pages which we need to redirect to the new ...
9
votes
4answers
2k views

Infinite URL Parameters for ASP.NET MVC Route

I need an implementation where I can get infinite parameters on my ASP.NET Controller. It will be better if I give you an example : Let's assume that I will have following urls : ...
4
votes
4answers
17k views

ASP.NET MVC Default route?

I created a new ASP.NET MVC project and implemented a site authorization filter. When I map the routes to the {controller}/{action} pair, I pass a role = "SomeRole" default to the route. It works ...
11
votes
1answer
8k views

ASP.net MVC custom route handler/constraint

I need to implement an MVC site with urls per below: category1/product/1/wiki category1/product/2/wiki category1/sub-category2/product/3/wiki category1/sub-category2/sub-category3/product/4/wiki ...
12
votes
5answers
6k views

Trailing slash on an ASP.NET MVC route

In the latest MVC preview, I'm using this route for a legacy URL: routes.MapRoute( "Legacy-Firefox", // Route name "Firefox-Extension/", // URL with parameters new { controller = "Home", action = ...
9
votes
2answers
6k views

How to get RouteData by URL?

I need to get RoutData by given URL string in ASP.NET MVC application. I've found the way that I need to mock HttpContextBase based on my URL string and then pass it to ...
20
votes
4answers
2k views

How can I create a route constraint of type System.Guid?

Can anyone point me in the right direction on how to map a route which requires two guids? ie. http://blah.com/somecontroller/someaction/{firstGuid}/{secondGuid} where both firstGuid and secondGuid ...

1 2 3 4 5 11
15 30 50 per page