Solved

C# parser error - finding previous project copied from

Posted on 2007-03-23
5
324 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 4

Expert Comment

by:Neotk
ID: 18781190
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
ID: 18784101
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
ID: 18787218
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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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