PDA

View Full Version : How to add existing user controls (.ascx) to new project?


Antonby
09-11-2005, 02:32 AM
I have a website that I am cloning. I created a new project in visual studio and used the 'Add existing item' option to get all the .aspx, .cs files into the project.The projectbuilds successfully but when I run it I get this error:

Parser Error Message: Could not load type 'ASPNET.StarterKit.Commerce.C_Header'.

Source Error:





Line 1: <%@ Control CodeBehind="_Header.ascx.cs" Language="c#" AutoEventWireup="false" Inherits="ASPNET.StarterKit.Commerce.C_Header" %>
Line 2: <%--
Line 3:
Source File: c:\inetpub\wwwroot\DrugEd\_Header.ascx Line: 1


Any idea how to rectify this?
The .ascx files do not show up in the Solution explorer..... could this be it? I cant seem to add these files directly to the project like I could the others.

tourneymanagerpro
09-12-2005, 07:18 AM
The problem is in the Line1. Your new project probably is not the ASPNET Starter Kit. Check the C_Header class for it's Namespace and replace the namespace on line 1.


[quote]

Line 1: <%@ Control CodeBehind="_Header.ascx.cs" Language="c#" AutoEventWireup="false" Inherits="ASPNET.StarterKit.Commerce.C_Header" %>
</CODE>