0

I have one area in my project (for admin).

I want to be able to use a view called Index.cshtml in the Admin area but my app always displays the Index.cshtml view for the main project (which isn't in a seperate area).

If I change the name of the view in the admin area to a name that doesn't exist anywhere else it works fine.

What am I missing? It must be something simple !

Answer (probably)

Bit of a mystery but it seems that maybe there was some sort of weird caching problem. I restarted the web server and now it works fine.

thanks to all who responded

K. Bob
  • 2,668
  • 1
  • 18
  • 16
  • Pass area name explicitly to avoid conflict in the order finding view – Birey Oct 31 '11 at 22:42
  • If you set breakpoints for your Index action in the controller in the main project and your Index action in the controller in the Admin area, which is getting hit? – counsellorben Oct 31 '11 at 22:44
  • @Birey - But for the default page, I'd hope to be able to just have http :// myserver.com/Admin and then it whisks me off to Admin/Home/Index. – K. Bob Oct 31 '11 at 22:46
  • @counsellorben - It's the admin controller that gets hit, like I say if the View name doesn't match an existing view name everything works fine. – K. Bob Oct 31 '11 at 22:49
  • What is the namespace for your Admin controller in your area? – counsellorben Oct 31 '11 at 22:57
  • The namespace is ghs.Areas.Admin and the namespace I've added in the areas RegisterArea is ghs.Areas.Admin.Controllers. – K. Bob Oct 31 '11 at 23:02

1 Answers1

0

Answered my own question to remove it from the unanswered list.

Bit of a mystery but it seems that maybe there was some sort of weird caching problem. I restarted the web server and now it works fine.

thanks to all who responded

K. Bob
  • 2,668
  • 1
  • 18
  • 16