Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 768593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:12:22+00:00 2026-05-14T18:12:22+00:00

In my MVC apps I normally declare a base view type that all of

  • 0

In my MVC apps I normally declare a base view type that all of my views inherit from. I get a parser error when I specify Inherits="MyView" in my Page declaration, but not if I specify Inherits="MyApp.Web.Views.MyView".

Strangely enough, it works fine if I specify a strongly typed view name: Inherits="MyView<T> (where T is any valid type).

Why can I specify a strongly typed view without the full type name, but not a generic view?

My base view class is declared like this:

namespace MyApp.Web.Views {
    public class MyView : MyView<object> {
    }

    public class MyView<TModel> : ViewPage<TModel> where TModel : class {
    }
}

UPDATE: Note that I do import MyApp.Web.Views via web.config. If I did not, then the strongly typed approach (Inherits="MyView<T>") wouldn’t work either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:12:23+00:00Added an answer on May 14, 2026 at 6:12 pm

    From another post: Here’s the underlying issue: the ASP.NET page parser does not support generics as a page type

    Read more here- Generic Inherited ViewPage<> and new Property

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

aspnet mvc has the HandleError filter that will return a view if an error
I've got a weird error in a couple MVC apps that I've not noticed
I'm trying to get better at using MVC/MVP style patterns with my WinForm apps
I was lead to believe that MVC apps were BIN-deployable, so could be deployed
I need help with the best practice to localize asp mvc apps, I saw
What's the point of the auto-generated 'designer' files in ASP.NET MVC Web Apps? I'm
Which MVC-framework is the best option (performance/ease of development) for a web application, that
Using ASP.NET MVC there are situations (such as form submission) that may require a
I have a copule of MVC apps. I'd like to be able to redirect
I've written several Web MVC apps but never before in PHP, and I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.