Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7878153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:34:49+00:00 2026-06-03T03:34:49+00:00

Again, I’m fairly new at this sort of thing and perhaps the error message

  • 0

Again, I’m fairly new at this sort of thing and perhaps the error message is telling me what it is and I’m simply not understanding, but… This code in anon.cs

namespace cheese.pies.org
{
    using System;
    using System.IO;
    using System.Net;
    using System.Web;
    using System.Xml;

    public class CasLogin : System.Web.UI.Page
    {
        private const string CasHost = "notimportant";

        public static string GetId()
        {
        }
}

Ends up giving me an error when referenced here:

<% @Page Language="C#" Inherits="CasLogin" CodeFile="CasLogin.cs" %>
<script language="C#" runat="server">
protected void Page_Load(object sender, EventArgs e) {
    String directoryId = CasLogin.GetId();
    FormsAuthentication.RedirectFromLoginPage(directoryId, false);
}
</script>

The error is on line one and is:

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).

If I change it from

public class CasLogin : System.Web.UI.Page

to

public class CasLogin : Page

I get this error:

Compiler Error Message: CS0246: The type or namespace name ‘Page’ could not be found (are you missing a using directive or an assembly reference?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:34:51+00:00Added an answer on June 3, 2026 at 3:34 am

    If I change it from public class CasLogin : System.Web.UI.Page to
    public class CasLogin : Page I get this error

    You are missing the correct using statement for the Page class (System.Web.UI) thus when you remove the full qualification the compiler can no longer find the Page class.

    You should also fully-qualify the class name in the Page directive, i.e. Inherits="cheese.pies.org.CasLogin"

    Good

    <% @Page Language="C#" Inherits="cheese.pies.org.CasLogin" CodeFile="CasLogin.cs" %>
    

    Bad

    <% @Page Language="C#" Inherits="CasLogin" CodeFile="CasLogin.cs" %>
    

    Per your comment regarding a missing partial modifier:

    public class CasLogin : System.Web.UI.Page
    

    Should be:

    public partial class CasLogin : System.Web.UI.Page
    

    This tells the compiler that the CasLogin class is defined in multiple files (which is the case with web forms; the designer file is separate from the code behind file).

    If it still doesn’t work, I suggest recreating the page and copying any relevant code into it. Normally Visual Studio handles all of this automatically and this is a non-issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Again, I am fairly new to C so forgive the simplicity / stupidity of
again i am trying with soap method, but this time i downloaded the charles
Again this is a homework. But trust me I've tried my best to solve
Help again guys, why do I always get this kind of error when using
Again i run into an error i don't mean to bug anyone but I'm
Again, I was creating buttons dynamically based on this post and now I need
Again, I saw this sentence: A .classpath file snippet that can be included in
Again I have a question regarding this plugin: http://t.wits.sg/2008/06/20/jquery-progress-bar-11/ What I want to achieve
Once again, I'm at a loss with IE7 on this one. I'm making a
Hello again codes masters, I'm stuck at this piece of codes for dropdown menu.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.