Spark will not automatically check the area views location in the current version. If you're willing to change the source (which i assume you are if you're doing mvc 2 stuff), here's the fix:
You have to modify the file src\Spark.Web.Mvc2\Descriptors\AreaDescriptorFilter.cs so that it reads as below (changes highlighted by **):
Note: I don't have the machine i did this on with me, so the slashes in the format string MIGHT need to be forward slashes.
Also, it is possible to create this class in your own code and pass it in when you register the view engine, but I don't remember the configuraiton code off the top of my head.
That's the approach I did since I wanted to modify the spark source as little as possible.
public class AreaDescriptorFilter : DescriptorFilterBase
{
**private const string areaPathFormatString = "~\\Areas\\{0}\\Views";**
public override void ExtraParameters(ControllerContext context, IDictionary<string, object> extra)
{
object value;
if (context.RouteData.Values.TryGetValue("area", out value))
extra["area"] = value;
}
public override IEnumerable<string> PotentialLocations(IEnumerable<string> locations, IDictionary<string, object> extra)
{
string areaName;
return TryGetString(extra, "area", out areaName)
**? locations.Select(x => Path.Combine(string.Format(areaPathFormatString,areaName), x)).Concat(locations)**
: locations;
}
}