How do I get past "Cannot load type: keepsake.Categories1" error in user control file?

I am trying to upgrade a 1.1 framework site to 2.0 because I do not have access to the 1.1 framework for recompiling the existing dll in the bin folder and I need to make changes to the ascx.vb file. When I rename the dll I get a Cannot load type error in the ascx file. the dll was named keepsake.dll. Is this the best way to approach the framework upgrade? Should there be a web.config entry for the user control? The 1.1 version of the site had the user control files (ascx and ascx.vb) in the document root folder. Can I leave them there or should I move them to a separate "controls" folder.

Please bear with me I am a .net newbie and have inherited a 1.1 site with no doc, etc. I am upgrading the site for the reasons stated in the previous paragraph.

Thank you!
Tim
Categories.ascx
--------------------
 
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="Categories.ascx.vb" Inherits="keepsake.Categories1" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<font face="arial" size="2">
	<asp:Repeater ID="rptLinks" Runat="server">
		<ItemTemplate>
			<a href='quinceanera.aspx?cat_id=<%# DataBinder.Eval(Container.DataItem, "cat_id")%>'><%# DataBinder.Eval(Container.DataItem, "cat_name")%></a><br>
		</ItemTemplate>
		<FooterTemplate>
			<br>
		</FooterTemplate>
	</asp:Repeater>
</font>
 
Categories.ascx.vb
-----------------------
Imports System.Data.SqlClient
 
 
Namespace keepsake
 
 
    Partial Class Categories1
        Inherits System.Web.UI.UserControl
 
#Region " Web Form Designer Generated Code "
 
        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
 
        End Sub
 
 
        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub
 
#End Region
 
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If (Not Page.IsPostBack) Then
                Dim objConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
                Dim objCommand As SqlCommand = New SqlCommand
                Dim objReader As SqlDataReader
 
                objCommand.CommandText = "SELECT * FROM Categories ORDER BY cat_name"
 
                objCommand.Connection = objConn
 
                objConn.Open()
                rptLinks.DataSource = objCommand.ExecuteReader
                rptLinks.DataBind()
                objConn.Close()
 
                objCommand.Dispose()
                objCommand = Nothing
 
                objConn.Dispose()
                objConn = Nothing
            End If
        End Sub
 
    End Class
 
End Namespace

Open in new window

bigmoxyAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
nmarunConnect With a Mentor Commented:
Tim,
If you are using Visual Studio, VS will automatically upgrade your project files to .net 2.0 when you open the solution. If you do not want to move the controls into a UserControls folder, you need not, the application should work just fine.

Also, compiling a .net 1.1 application in a .net 2.0 framework should work just fine. Was the compilation failing back then?

One more thing, is 'keepsake' the root namespace? In other words, is this the web application itself?
0
 
Bob LearnedConnect With a Mentor Commented:
If you are upgrading to a Web Site model, where there is no project file, then the CodeBehind attribute needs to be changed to a CodeFile attribute, or you will get that error.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.