Solved

C# parser error - finding previous project copied from

Posted on 2007-03-23
5
323 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
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 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