Solved

C# parser error - finding previous project copied from

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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

16 Experts available now in Live!

Get 1:1 Help Now