views:

100

answers:

1

I'm brand new to MVC and, as a learning exercise, I'm trying to re-write an old application as an ASP.NET MVC application. I'm a little unclear about some conventions which the question Action Naming Conventions only partially covers.

Lets say I have two controllers: JobController and ClientController. Both of the controllers are going to have identical actions: List, Details, New, Update, and Delete.

Should the views for these actions be named identically to the action? In this case the List action for JobController should have a view named "List.aspx" as opposed to something like "JobList.aspx".

The reason this question came to my mind was that I was unsure if its appropriate to have multiple views with the same name (such as "List.aspx"). This will get more and more relavent as I continue adding controllers as pretty much every business object in my system will require a "List.aspx" of some sort.

+1  A: 

They won't really have the same name. If it were important to give all our files different names why would we want folders? You actually have a Job/List.aspx and a Client/List.aspx.

AnthonyWJones
I can certainly think of some reasons based on past WinForm projects I've done. Somebody might want to refactor the project folders and if all the forms had the same name it could cause a real problem. I know MVC is different, and rigid dir structures seem to be a significant one.
Sailing Judo
It's a valid concern, but I think I would rather run that very low risk than have to put up with having to tag my controller name in front of all my views. You are correct MVC has a fairly rigid structurem not using it would be very disconcerting for other MVC developers to follow.
AnthonyWJones