Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Parser error

Parser error

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netgraphicsdesignsysadmin
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nisrinee51
    wrote on last edited by
    #1

    When I run my code, I get a parser error saying Server Error in '/CopyFIles1' 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 'CopyFIles1.Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="CopyFIles1.Global" %> Source File: c:\inetpub\wwwroot\CopyFIles1\global.asax Line: 1 _----------------------------------------------------------------------------------- This is the code that I have so far that lists files from a directory with checkboxes and the copy the checked files to copy to server. I m still new to coding in ASP.NET and C# ------------------------------------------------------------------------------------ using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.IO; namespace CopyFIles1 { /// /// Summary description for WebForm1. /// public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.CheckBoxList CheckBoxList1; protected System.Web.UI.WebControls.Button Button1; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.CheckBoxList1.SelectedIndexChanged += new System.EventHandler(this.CheckBoxList1_SelectedIndexChanged); this.Button1.Click += new System.EventHandler(this.Button1_Click); this.Load += new System.EventHandler(this.Page_Load); } #endregion private void CheckBoxList1_SelectedIndexChanged(object sender, System.EventArgs e) { DirectoryInfo d = new DirectoryInfo("C:\\myDocuments\\Test"); System.Collections.ArrayList myL

    C A 2 Replies Last reply
    0
    • N nisrinee51

      When I run my code, I get a parser error saying Server Error in '/CopyFIles1' 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 'CopyFIles1.Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="CopyFIles1.Global" %> Source File: c:\inetpub\wwwroot\CopyFIles1\global.asax Line: 1 _----------------------------------------------------------------------------------- This is the code that I have so far that lists files from a directory with checkboxes and the copy the checked files to copy to server. I m still new to coding in ASP.NET and C# ------------------------------------------------------------------------------------ using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.IO; namespace CopyFIles1 { /// /// Summary description for WebForm1. /// public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.CheckBoxList CheckBoxList1; protected System.Web.UI.WebControls.Button Button1; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.CheckBoxList1.SelectedIndexChanged += new System.EventHandler(this.CheckBoxList1_SelectedIndexChanged); this.Button1.Click += new System.EventHandler(this.Button1_Click); this.Load += new System.EventHandler(this.Page_Load); } #endregion private void CheckBoxList1_SelectedIndexChanged(object sender, System.EventArgs e) { DirectoryInfo d = new DirectoryInfo("C:\\myDocuments\\Test"); System.Collections.ArrayList myL

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      nisrinee51 wrote: public class WebForm1 : System.Web.UI.Page Your codebehind class is called WebForm1, and your aspx is looking for a class called Global. Change one or the other so both are the same. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

      1 Reply Last reply
      0
      • N nisrinee51

        When I run my code, I get a parser error saying Server Error in '/CopyFIles1' 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 'CopyFIles1.Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="CopyFIles1.Global" %> Source File: c:\inetpub\wwwroot\CopyFIles1\global.asax Line: 1 _----------------------------------------------------------------------------------- This is the code that I have so far that lists files from a directory with checkboxes and the copy the checked files to copy to server. I m still new to coding in ASP.NET and C# ------------------------------------------------------------------------------------ using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.IO; namespace CopyFIles1 { /// /// Summary description for WebForm1. /// public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.CheckBoxList CheckBoxList1; protected System.Web.UI.WebControls.Button Button1; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.CheckBoxList1.SelectedIndexChanged += new System.EventHandler(this.CheckBoxList1_SelectedIndexChanged); this.Button1.Click += new System.EventHandler(this.Button1_Click); this.Load += new System.EventHandler(this.Page_Load); } #endregion private void CheckBoxList1_SelectedIndexChanged(object sender, System.EventArgs e) { DirectoryInfo d = new DirectoryInfo("C:\\myDocuments\\Test"); System.Collections.ArrayList myL

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        I may be totally wrong but I think your biggest problem is that you are using the global.asax file as a normal page, which is not quite right. The global.asax should not be accessed by users, it sits as an application support file and provides application and session object handling. When you start a new project it has session_onend and a bunch of useful functions. It looks like you have copied the contents of an aspx.cs file and pasted it into the global.asax.cs file. If you don't need the global.asax file (you don't always need it, many of our projects don't) just delete it to reduce confusion. If you do need it then use VS.NET to recreate it and then make sure to compile your app properly. Take the contents above and put it back into the aspx.cs file you had it in originally.

        N 1 Reply Last reply
        0
        • A Anonymous

          I may be totally wrong but I think your biggest problem is that you are using the global.asax file as a normal page, which is not quite right. The global.asax should not be accessed by users, it sits as an application support file and provides application and session object handling. When you start a new project it has session_onend and a bunch of useful functions. It looks like you have copied the contents of an aspx.cs file and pasted it into the global.asax.cs file. If you don't need the global.asax file (you don't always need it, many of our projects don't) just delete it to reduce confusion. If you do need it then use VS.NET to recreate it and then make sure to compile your app properly. Take the contents above and put it back into the aspx.cs file you had it in originally.

          N Offline
          N Offline
          nisrinee51
          wrote on last edited by
          #4

          I deleted the Globa.asax file and this is now the error that I get, any idea how to fix it? 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 'CopyFIles1.WebForm1'. Source Error: Line 1: <%@ Page language="c#" Codebehind="Global.aspx.cs" AutoEventWireup="false" Inherits="CopyFIles1.WebForm1" %> Line 2: Line 3: Source File: c:\inetpub\wwwroot\CopyFIles1\Global.aspx Line: 1

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups