The page is not allowed here because it does not extend the "System.Web.UI.MasterPage" class

I am creating a website using the master page which works great. but after adding entity data model and some fetch code to login page, some errors occur.

the code is like

var tombstoneQuery = from t in crnnsupContext.Tombstones.Include("ProvState")
                             where t.RegNumber == _username
                             select t;
List<Tombstone> tombstoneResult = tombstoneQuery.ToList();
Cache.Insert("Tombstone", tombstoneResult);

      

the first error comes when I try to put the list in Cache, the error says "Thread has been canceled. After I set the cache.insert statement as great, this error disappeared and the next one appeared

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: 'OnlineRenewal.Renewal' is not allowed here because it does not extend class 'System.Web.UI.MasterPage'.

Source Error: 


Line 1:  <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="renewal.Master.cs" Inherits="OnlineRenewal.Renewal" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      

The update is the main page where I didn't do anything with it. can anyone help? many thanks

code for the update page. (there is)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace OnlineRenewal
{
public partial class renewal : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
}




<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="renewal.Master.cs" Inherits="OnlineRenewal.Renewal" %>

      

+3


source to share


1 answer


This tells you what is OnlineRenewal.Renewal

not the main page.



Make sure it has the directive <%@ Master %>

at the top of the page, or change the inherits attribute on the page causing this error to do something else.

+4


source