While playing with the new MVC bit. I found some unusual case. Let’s say I have created a Master Page which takes a strongly typed class as its ViewData and the Content Page takes a subclass of the previously mentioned strongly typed ViewData class. The Folloiwng are the signatures:
public class BasicViewData
{
}
public class SubclassViewData : BasicViewData
{
}
public partial class SiteMasterPage : ViewMasterPage<BasicViewData>
{
}
public partial class SiteContentPage : ViewPage<SubclassViewData>
{
}
And I dont think there is anything wrong with the above, usually we want to put the common things in the master pages like Menu, Tag Cloud etc where it will be shown in every pages and in the content page we put page specific items. But when I try to run it no compile time error but when navigating to that content page, it is throwing "A ViewMasterPage<TViewData> can only be used with content pages that derive from ViewPage<TViewData>." It seems it works in the reverse direction, which i think does not add any value for having a Master Page. Certainly I can use the view data base class in the content page and cust it back to subclass, but having lots of content page it will become pain in the neck.
Any thoughts on this Issue.
Long Live .NET
Kazi Manzur Rashid (Amit)
_________________________
http://weblogs.asp.net/rashid/