[Mono-bugs] [Bug 494245] New: ASP.NET Pages not accepting base class with generic type

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Apr 12 20:12:44 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=494245


           Summary: ASP.NET Pages not accepting base class with generic
                    type
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Other.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: padcom at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8)
Gecko/2009032609 Firefox/3.0.8

ASP.NET Pages not accepting base class with generic type.

This works:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs"
Inherits="MyBlog.Views.Home.Index" %>

This throws the exception below:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs"
Inherits="MyBlog.Views.Home.Index<MyBlog.Models.BlogList" %>

System.InvalidOperationException: The view 'Index' or its master could not be
found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/HomeIndex.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
  at System.Web.Mvc.ViewResult.FindView (System.Web.Mvc.ControllerContext
context) [0x00000]
  at System.Web.Mvc.ViewResultBase.ExecuteResult
(System.Web.Mvc.ControllerContext context) [0x00000]
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult
(System.Web.Mvc.ControllerContext controllerContext,
System.Web.Mvc.ActionResult actionResult) [0x00000]
  at
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass11.<InvokeActionResultWithFilters>b__e
() [0x00000]
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter
(IResultFilter filter, System.Web.Mvc.ResultExecutingContext preContext,
System.Func`1 continuation) [0x00000]

BlogList is any class - it's just an example.

It works just fine with MS implementation.
It is needed for strongly-typed views in ASP.NET MVC.

Reproducible: Always

Steps to Reproduce:
1. Create a model class in Models folder called BlogList
2. Create a view
3. Make the view inherit from the generic version instead of the non-generic
one as shown in the details section.
4. Navigate to the action returning the view to see the exception.
Actual Results:  
System.InvalidOperationException: The view 'Index' or its master could not be
found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/HomeIndex.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
  at System.Web.Mvc.ViewResult.FindView (System.Web.Mvc.ControllerContext
context) [0x00000]
  at System.Web.Mvc.ViewResultBase.ExecuteResult
(System.Web.Mvc.ControllerContext context) [0x00000]
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult
(System.Web.Mvc.ControllerContext controllerContext,
System.Web.Mvc.ActionResult actionResult) [0x00000]
  at
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass11.<InvokeActionResultWithFilters>b__e
() [0x00000]
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter
(IResultFilter filter, System.Web.Mvc.ResultExecutingContext preContext,
System.Func`1 continuation) [0x00000]

Expected Results:  
No exception is thrown AND the ViewData.Model instance is of the given type
instead of just a plain object.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list