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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Could not load type

Could not load type

Scheduled Pinned Locked Moved ASP.NET
csharphelpdesignsysadminwindows-admin
2 Posts 2 Posters 1 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.
  • K Offline
    K Offline
    kourvoisier
    wrote on last edited by
    #1

    I am simply trying to use the uploadfile control with no success. Also the remote server uses .net 1.0 If you cant help me with this error please tell me a different way of uploading files to a server using .net 1.0 The following is the error i keep getting: ------------------------------------------------------- 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 'upload'. Source Error: Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="upload" %> Line 2: Line 3: Source File: d:\webs\omixad\upload.aspx Line: 1 --------------------------------------------------------- I have a simple upload.aspx file that has a fileupload object on it and actually uploads files to the server. ---------------------------------------------------------------------------------------------- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="upload" %> <script>

    ------------------------------------------------------------------------------------------- The code behind file is upload.aspx.cs ----------------------------------------------------------------------- using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class upload : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void UploadBtn_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { //FileUpload1.SaveAs(@"C:\temp\" + FileUpload1.FileName); FileUpload1.SaveAs(Server.MapPath(@"temp") + FileUpload1.FileName); Label1.Text = "File Uploaded: " + Server.MapPath(@"temp\") + FileUpload1.FileName; } else { Label1.Text = "No File Uploaded."; } } } --------------------------------------------------------------------- I have IIS running o

    M 1 Reply Last reply
    0
    • K kourvoisier

      I am simply trying to use the uploadfile control with no success. Also the remote server uses .net 1.0 If you cant help me with this error please tell me a different way of uploading files to a server using .net 1.0 The following is the error i keep getting: ------------------------------------------------------- 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 'upload'. Source Error: Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="upload" %> Line 2: Line 3: Source File: d:\webs\omixad\upload.aspx Line: 1 --------------------------------------------------------- I have a simple upload.aspx file that has a fileupload object on it and actually uploads files to the server. ---------------------------------------------------------------------------------------------- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="upload" %> <script>

      ------------------------------------------------------------------------------------------- The code behind file is upload.aspx.cs ----------------------------------------------------------------------- using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class upload : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void UploadBtn_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { //FileUpload1.SaveAs(@"C:\temp\" + FileUpload1.FileName); FileUpload1.SaveAs(Server.MapPath(@"temp") + FileUpload1.FileName); Label1.Text = "File Uploaded: " + Server.MapPath(@"temp\") + FileUpload1.FileName; } else { Label1.Text = "No File Uploaded."; } } } --------------------------------------------------------------------- I have IIS running o

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, Basically, you cannot use the new features in the ASP.NET 2.0 like the partial class, CodeFile attribute, FileUpload control .... to run with the ASP.NET 1.0. The reason it's working on you machine is simply that you use the right version 2.0 in your local environment. On the remote server, they use an older version of ASP.NET (1.0), so you need to go back with the options provided by the ASP.NET 1.0, there are a couple of things that you might need to change in order ton run on the remote machine: + Use the inline code instead of the code-behind with the partial class. + Use the HtmlInputFile[^] control instead of the FileUpload control. Below is a quick example for the changes:

      <%@ Page Language="C#" %>
      <html>
      <head runat="server">
      <title>Untitled Page</title>
      <script runat="server">
      protected void UploadBtn_Click(object sender, EventArgs e)
      {
      //TO DO: your code goes here to save the uploaded file.
      }
      </script>
      </head>
      <body>
      <form id="form1" runat="server">
      <input id="File1" runat="server" type="file" />
      <asp:Button ID="Button1" runat="server" Text="Upload"
      On_Click="UploadBtn_Click"/>
      </form>
      </body>
      </html>

      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