Solved

C# parser error - finding previous project copied from

Posted on 2007-03-23
5
317 Views
Last Modified: 2012-05-05
I'm getting a parser error message that refers back to a project that this project was copied from.  This name "PSMPortal" does not exist anywhere in this project.   clsHeadTable1 is defined everywhere in the project exactly the same but does not get this 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: The base class includes the field 'ButtonBar1', but its type (PSMPortal.ButtonBar) is not compatible with the type of control (ASP.ButtonBar_ascx).

Source Error:


Line 25:                   <CHN:clsheadtable id="ClsHeadTable1" runat="server"></CHN:clsheadtable>
Line 26:                   <p style="MARGIN-TOP:-15px">
Line 27:                         <CHN:ButtonBar id="ButtonBar1" runat="server"></CHN:ButtonBar></p>

 
0
Comment
Question by:dcass
  • 2
5 Comments
 
LVL 4

Expert Comment

by:Neotk
Comment Utility
PSMPortal is the namespace where the button is in.

You can change your buttonbar namespace and add a reference in your project.

Look in web.config, maybe there will be the reference to PSMPortal, there you should change its name to your new setted namespace.

Regards
Rodrigo Matias Leote
0
 

Author Comment

by:dcass
Comment Utility
There are no references to PSMPortal in the project at all.  When I put CHN.ButtonBar, I get an error that says that I can't reference outside this project.  The project and then namespace is CHN.
Here is the code:
<%@ Register TagPrefix="CHN" TagName="ButtonBar" Src="../ButtonBar.ascx" %>
<%@ Register TagPrefix="CHN" TagName="clsHeadTable" Src="../clsHeadTable.ascx" %>
<%@ Page language="c#" Codebehind="CycleAdd.aspx.cs" AutoEventWireup="false" Inherits="CalendarApp.CycleAdd" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
      <HEAD>
            <title>Block</title>
            <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
            <meta content="C#" name="CODE_LANGUAGE">
            <meta content="JavaScript" name="vs_defaultClientScript">
            <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
      </HEAD>
      <body>
            <form id="Block" method="post" runat="server">
                  <CHN:clsheadtable id="ClsHeadTable1" runat="server"></CHN:clsheadtable>
                  <p style="MARGIN-TOP:-15px">
                        <CHN:ButtonBar id="ButtonBar1" runat="server"></CHN:ButtonBar></p>
                  

and then the aspx (not the whole thing but what I think is relevant):
namespace CalendarApp
{
      public class CycleAdd : System.Web.UI.Page
      {
            protected System.Web.UI.WebControls.Button Button1;
            protected System.Web.UI.WebControls.Button Button2;
            protected ButtonBar ButtonBar1;
            private void Page_Load(object sender, System.EventArgs e)
            {
// load data table
                                  }
                }
}


#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
      InitializeComponent();
      base.OnInit(e);
      if (!IsPostBack)
      {                        
          InitializeUISelectors();
          ButtonBar1.ShowAddButton = false;
          ButtonBar1.ShowDeleteButton = false;
          ButtonBar1.ShowPrintButton = false;
          ButtonBar1.ShowUpdateButton = false;                     ButtonBar1.BarButtonClicked +=new AnyButtonClicked(ButtonBar1_BarButtonClicked);
                   }
}
private void InitializeComponent()
{    
      this.Button1.Click += new System.EventHandler(this.Button1_Click);
      this.Button2.Click += new System.EventHandler(this.Button2_Click);
      this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
    AddModeledCall();
    Response.Redirect("CycleAdd.aspx");
}
private void Button2_Click(object sender, System.EventArgs e)
{
    Response.Redirect("ManageCycles.aspx");
}
private void AddModeledCall()
{
// stuff that works in previous project copied from
}


Please help!  
0
 

Accepted Solution

by:
dcass earned 0 total points
Comment Utility
I solved it - I recreated the project under a different name and copied everything back in and the problem went away - since this has happened to me before, I assume it's a .NET bug - I'm using the older version, but I'm getting it into the new one asap.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now