views:

35

answers:

1

Hello,

I've got my ASP.NET MVC 2 application divided into few areas. One of them is a default area in main catalog, the other is Account area in Areas catalog. Now the problem is, that I need to use the same view in controllers from both of this areas.

Now If they would be in the same area I will just return View("ViewName") and it's okay, but what can I do to return view from my default area in controller from my Account area? Any ideas?

Thanks in advice for all your help.

+3  A: 

You could specify the relative location of the view:

return View("~/Views/YourArea/YourController/YourView.aspx");

But when a view is shared among multiple areas I would recommend you to use the ~/Views/Shared folder which serves better this purpose.

Darin Dimitrov
Thank you Darin - I will try this one.
ŁukaszW.pl