I'm using ASP.NET MVC2 RC and I have built security on top of the Areas/Controller/Action specification, using basically a table that tells the infrastructure which role has permission to execute which controller action.
The code I used to get the "area" was this
RouteData.Values["area"]
And then I checked that in the Database. My problem is that when I migrated from MVC 1 RTM to MVC2 RC, the area goes in the DataTokens collection, and if the controller that is being called is in the root area, the following code returns null
RouteData.DataTokens["area"]
Do you know if there's any way to tell MVC that if "area" is not in the DataTokens collection, it should have string.Empty?
I'm trying to avoid modifying my code to check that for null.
Thanks!