Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Amar 3 posts 23 karma points
    Apr 05, 2011 @ 12:34
    Amar
    0

    Make sure that the class defined in this code file matches the 'inherits' attribute

    Hi there,

     

    I have created .aspx page using templates and put code behind page and inherits as well.

     

    i ma getting below error on page

    Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

     

    i am using .net 3.5 and site is hosted on IIS 7.

     

    hope it helps

     

    Thanks

  • Amar 3 posts 23 karma points
    Apr 05, 2011 @ 12:47
    Amar
    0

    Hi there,

     

    see below page where i am getting error

     

    http://www.leadsale.co.uk/Login.aspx

    Thanks

  • Amar 3 posts 23 karma points
    Apr 05, 2011 @ 14:57
    Amar
    0

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

    Source Error:

    Line 8:  
    Line 9:
    Line 10: public partial class Login : System.Web.UI.Page
    Line 11: {
    Line 12: LeadSale ls = new LeadSale();
  • Iain Brogden 7 posts 27 karma points
    Feb 25, 2013 @ 19:07
    Iain Brogden
    0

    Hi I have the same issue. I am getting this error:

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

    Source Error:

     
    Line 5:  using System.Web.UI.WebControls;
    Line 6:  using System.Net.Mail;
    Line 7: public partial class SignUp : System.Web.UI.Page Line 8:  {
    Line 9:      protected void Btn_SignUp_Click(object sender, EventArgs e)

    I have an existing website I am migrating to Umbraco and there is a page to sign up to an email list. I already built the code behind file and it worked fine outside Umbraco. I have read many articles on the forum about code behind but don't find exactly the answer I need, maybe due to my inexperience with Umbraco.

    I have created a template for the Signup.aspx page and first line is:

    <%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" CodeFile="SignUp.aspx.cs" Inherits="SignUp" %>

    I have placed the code behind file SignUp.aspx.cs in the masterpages folder of the site root.

    The first few lines of code for Signup.aspx.cs is as follows:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Net;
    using System.Web.UI.WebControls;
    using System.Net.Mail;
    public partial class SignUp : System.Web.UI.Page
    {
        protected void Btn_SignUp_Click(object sender, EventArgs e)
        {

    Can anyone provide guidance - why doesn't this work within Umbraco templates. Is it something to do with it all being wrapped with
    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %> ?

    Any guidance much appreciated.

  • Iain Brogden 7 posts 27 karma points
    Mar 11, 2013 @ 17:31
Please Sign in or register to post replies

Write your reply to:

Draft