Link to home
Start Free TrialLog in
Avatar of brgdotnet
brgdotnetFlag for United States of America

asked on

error message "Could not load type" for a .NET 1.1 asp project converted to VS 2008 .NET 3.5

I am working with some code that was developed in the year 2004. So I suppose that it is .NET 1.1 code.  
I created a visual studio 2008 project but am getting an error when I try and build the code. . One obvious problem appears to be that the attribute "CodeFile" is being used. Please check out the code I am providing and tell me if you can spot the problem which is creating the bug. Here is the error message I am getting:
Error      13 Could not load type 'CaptchaImage.JpegImage'.      C:\America\JpegImage.aspx      

Here is the .aspx code:
<%@ Page language="c#" Codebehind="JpegImage.aspx.cs" AutoEventWireup="false" Inherits="CaptchaImage.JpegImage" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>JpegImage</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body>
<form id="JpegImage" method="post" runat="server">
</form>
</body>
</html>
----------------------------Below is the C# code--------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
 
namespace CaptchaImage
{
 public class JpegImage : System.Web.UI.Page
 {
	private void Page_Load(object sender, System.EventArgs e)
		{
// Create a CAPTCHA image using the text stored in the Session object.
CaptchaImage ci = new CaptchaImage(this.Session["CaptchaImageText"].ToString(), 200, 50, "Century Schoolbook");
// Change the response headers to output a JPEG image.
	this.Response.Clear();
	this.Response.ContentType = "image/jpeg";
 
	// Write the image to the response stream in JPEG format.
	ci.Image.Save(this.Response.OutputStream, ImageFormat.Jpeg);
 
	// Dispose of the CAPTCHA image object.
	ci.Dispose();
		}
 
#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);
}
		
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
	private void InitializeComponent()
	{    
	this.Load += new System.EventHandler(this.Page_Load);
	}
		#endregion
	}
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gyanendra Singh
Gyanendra Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brgdotnet

ASKER

Thank you. Great job!
your welcome