How to add existing user controls (.ascx) to new project?

Discussion in 'ASP.NET / ASP.NET Core' started by Antonby, Sep 11, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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:





    Code:
    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.
     
  2. 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.


     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page