0
votes

So I need to develop a web form to get data from the scanner. But I encounter a problem stating that " "is not allowed here because it does not extend class 'System.Web.UI.Page'. As I'm aware that this topic is already been discussed, I still not able to solve it.

I have tried this steps but none of this working..

  1. Webform not allowed because it does not extend Class

  2. Parser Error: '_Default' is not allowed here because it does not extend class 'System.Web.UI.Page' & MasterType declaration

  3. Webform not allowed because it does not extend Class

and already skim thorugh this https://weblog.west-wind.com/posts/2005/Sep/12/Understanding-Page-Inheritance-in-ASPNET-20 to understand more about the inheritance.

this is the lalala.aspx file

<%@ Page Language="C" AutoEventWireup="true" CodeBehind="lalala.aspx.cs" Inherits="TEST.lalala" %>

this is the lalala.aspx.cs file

namespace TEST
{
public partial class lalala : Form
{
// 
}
}

I really think that this error is cause by the page inheritance but I don't know how to fix it.. Please someone guide me

1
public partial class lalala : Form - What is the Form class? Does it inherit or extend System.Web.UI.Page? if not that is your problem.Jon P

1 Answers

1
votes

Try this (presuming you are not using a master page):

namespace TEST
{
    public partial class lalala : System.Web.UI.Page
    {

    }
}