locked
Parser error RRS feed

  • Question

  • User364663285 posted

    Hi,

    How to resolve error below?

    Server Error in '/' Application.
    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: Could not load type 'Login._Default'.
    
    Source Error:
    
    
    Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Login._Default" %>
    Line 2:  
    Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    Source File: /login6/Default.aspx    Line: 1
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3701.0

    Friday, January 1, 2021 1:29 PM

Answers

  • User475983607 posted

    Hi,

    Is it due to line below? How to adjust it?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Login._Default" %>

    I think so... Here in the forum we can only see the information you share.  Given the error message and the page directive, I assume you updated the folder name and page directive without also changing the code behind namespace.   I have no idea what you actually did because you did not share any relevant information.  

    I recommend starting over and creating a new page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 2, 2021 2:52 PM

All replies

  • User475983607 posted

    The error is very clear.  The error is telling you login._Default, the code behind, could not be loaded.

    Given your other recent thread(s); https://forums.asp.net/p/2173324/6328597.aspx?404+error 

    I assume you updated the page directive login6 to login and a folder form login6 to login but did not the update the code behind namespace to match login. The namespace is probably still login6 and why it cannot be loaded.

    Maybe start over and create a new login/default.aspx page rather than trying to fix the name changes.

    Friday, January 1, 2021 1:46 PM
  • User364663285 posted

    Hi,

    Is it due to line below? How to adjust it?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Login._Default" %>
    


     

    Saturday, January 2, 2021 1:03 PM
  • User475983607 posted

    Hi,

    Is it due to line below? How to adjust it?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Login._Default" %>

    I think so... Here in the forum we can only see the information you share.  Given the error message and the page directive, I assume you updated the folder name and page directive without also changing the code behind namespace.   I have no idea what you actually did because you did not share any relevant information.  

    I recommend starting over and creating a new page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 2, 2021 2:52 PM
  • User-1545767719 posted

    Check if all the class names used in the Default.aspx, Default.aspx.cs and Default.aspx.designer.cs are the same.  If you produced the ASP.NET Web Forms project using the Visual Studio template, the automatically generated class names of Default page will be "_Default" as follows:

    Default.aspx

    <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" 
        AutoEventWireup="true" CodeBehind="Default.aspx.cs" 
        Inherits="WebApplication2._Default" %>

    Default.aspx.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebApplication2
    {
        public partial class _Default : Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        }
    }

    Default.aspx.designer.cs

    namespace WebApplication2
    {
    
    
        public partial class _Default
        {
        }
    }

    Your problem can be reproduced when the class names "_Default" in Default.aspx.cs and Default.aspx.designer.cs are changed to "Default" according to the guidance shown by the Visual Studio editor.

    Monday, January 4, 2021 1:41 AM