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

by
Jeremy Canfield |
Updated: March 12 2020
| Visual Studio articles
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"
%>
Did you find this article helpful?
If so, consider buying me a coffee over at
Comments
August 04 2022 by kishan
nice!