ASP.Net MVC2 - Areas Question

Soldato
Joined
18 Oct 2002
Posts
16,080
Location
The land of milk & beans
Hey all,

Just looking at the feasibility of a system at the minute. This will be the first time I've used areas in anger, so want to make sure this will work as I want it :)

I'm having a problem with my URLs. Basically, I've got my areas set out something like this:

Code:
+ Admin
	+ Controllers
		PageController.cs
		NewsController.cs
	- Models
	+ Views
		+ Page
			Edit.aspx
			Create.aspx
			List.aspx
		+ News
			Edit.aspx
			Create.aspx
			List.aspx
			
+ FrontEnd
	+ Controllers
		PageController.cs
		NewsController.cs
	- Models
	+ Views
		+ Page
			Index.aspx
		+ News
			Index.aspx
			Archive.aspx

Now, the admin is fine. The URLs here will be something along the lines of http://site.com/admin/news/edit/23/ - all good.

However, the front end will be http://site.com/frontend/news/article-name/.

Is there any way to remove that leading /frontend/ - without having to manually create a route in global.asax each time?
 
Thank spoonjaffa - I've just had a read and it looks like you can use Areas with the MVC1 way of doing it at root level. I assumed it was one or the other.

I'll keep the admin in it's own area and put the web-facing elements at root level.

Cheers for the help.
 
Back
Top Bottom