Resolve error "Parser Error is not allowed here because it does not extend class System.Web.UI.Page" in Visual Studio

Home > Search
  by

Follow these directions to fix error 'Parser Error is not allowed here because it does not extend class System.Web.UI.Page' in Visual Studio. This error typically appears due to some issue between the Master Page and the Content Page. The very first line of the Content Page has a line of code for the Master Page being used. Notice near the end of this line is code such as Inherits='stage.index'. The Inherits is related to this error.

The easy fix to this problem is to name the page default.aspx instead of index.aspx.

<%@ 
Page Title="" 
Language="vb" 
AutoEventWireup="false" 
MasterPageFile="~/MasterPages/Content.Master" 
CodeBehind="index.aspx.vb" 
Inherits="stage.index" 
%>

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments