Resolved: … is not allowed here because it does not extend class “System. Web. UI. Page”

Whenever you see such error while building websites, web applications or migration from previous versions to higher where mostly encounters.

Don’t panic it is pretty simple but needs attention.

The issue is only in one line of code where you find page directive.

To be more specific I mostly observe this error encountered because of inherits attribute of page directive tag of markup page.

For an instance, adding a aspx page to existing project having multiple directories like registration, sales, services, logs, geographies.

I need to add aspx page to geographies directory of web project. To do it I just right click on geographies directory and click add new item then give name to it and save.

Before you start execution have a look on page directive where you may find improper directive, may be as below:

<%language =vb code behind = page name. Aspx. Vb inherits =forex. Webapp. Pagename. Aspx%>

And this causes error as mentioned in title of post. To get rid of it, it is needed to verify the line as below

<%language =vb code behind = page name. Aspx. Vb inherits =forex. Webapp. Geographies. Pagename. Aspx%>

Hope it may be useful to other geeks.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s