473,594 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error With my Class - 'object' does not contain definition for ...my property

1 New Member
The error is surrounded in stars near the bottom of the code, any help would be appreciated!


namespace USDP.eCFUtiliti es {
/// <summary>
/// Summary description for CatalogHelper
/// </summary>
///

public class USDPCategoryObj ect {
protected string c_CategoryName;
protected int c_CategoryId;
protected ArrayList c_ChildCategori es = new ArrayList();

public String CategoryName {
get { return c_CategoryName; }
set { c_CategoryName = value; }
}

public Int32 CategoryId {
get { return c_CategoryId; }
set { c_CategoryId = value; }
}

public ArrayList ChildCategories {
get { return c_ChildCategori es; }
set { c_ChildCategori es = value; }
}

}

public class CatalogHelper {

public CatalogHelper() {
//
// TODO: Add constructor logic here
//
}

public static SiteNode[] GetChildCategor ies(string CategoryId) {
ErrorsError[] errors = new ErrorsError[] { };
SiteNode[] node = ClientCatalog.L ookupCategories (new int[1] { Convert.ToInt32 (CategoryId) }, new string[] { "Children", "Ancestors" , "ItemAttributes ", "ItemMetaAttrib utes", "Pages", "AccessLeve ls" }, ref errors);
return node[0].Children;
}

public static ArrayList GetAllChildCate gories(string CategoryId) {
ArrayList ChildrenObjects = new ArrayList();

ErrorsError[] errors = new ErrorsError[] { };
SiteNode[] node = ClientCatalog.L ookupCategories (new int[1] { Convert.ToInt32 (CategoryId) }, new string[] { "Children", "Ancestors" , "ItemAttributes ", "ItemMetaAttrib utes", "Pages", "AccessLeve ls" }, ref errors);
ErrorsError[] errors2 = new ErrorsError[] { };


if (node[0].Children.Lengt h > 0) {
for (int i = 0; i < node[0].Children.Lengt h; i++) {
USDPCategoryObj ect co = new USDPCategoryObj ect();
co.CategoryId = Convert.ToInt32 (node[0].Children.SiteN odeId);
co.CategoryName = node[0].Children.Name;

SiteNode[] node2 = ClientCatalog.L ookupCategories (new int[1] { co.CategoryId }, new string[] { "Children", "Ancestors" , "ItemAttributes ", "ItemMetaAttrib utes", "Pages", "AccessLeve ls" }, ref errors2);
if (node2[0].Children.Lengt h > 0) {
for (int x = 0; x < node2[0].Children.Lengt h; x++) {
USDPCategoryObj ect co2 = new USDPCategoryObj ect();
co2.CategoryId = Convert.ToInt32 (node2[0].Children[x].SiteNodeId);
co2.CategoryNam e = node2[0].Children[x].Name;
co.ChildCategor ies.Add(co2);
}
}

ChildrenObjects .Add(co);
}
}
*************** ***************
The following line generate this error:

'object' does not contain a definition for 'CategoryName'
*************** ***************
Response.Write( ChildrenObjects[0].CategoryName);
*************** ***************
}

}

}
Jun 20 '07 #1
0 2376

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4731
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
1
1699
by: Roland | last post by:
Hi All, I'm trying to generate a C# wrapper for a Windows type library using the following command line ... csc /target:library /doc:Interop.MyLibrary.xml /unsafe Interop.MyLibrary.cs >Interop.MyLibrary.log And receiving the following error message ... Interop.MyLibrary.cs(499,18): error CS0536: 'Interop.MyLibrary.IImpBaseCollection_SinkHelper' does not implement interface member 'Interop.MyLibrary.IImpBaseCollection.Item(object)'....
8
6003
by: Joe | last post by:
I have several classes which I need serialized. Here is their class definitions: public class TopContainer { private LevelTwoType m_levelTwo; public LevelTwoType LevelTwo { get {
0
3809
by: Michelle Keys | last post by:
Subject: DataBinder.Eval Error! Server Error in '/MSPOS' Application. ------------------------------------------------------------------------ -------- DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name REPORTTO. Description: An unhandled exception occurred during the execution of the
3
2270
by: Hans De Schrijver | last post by:
I have an assembly with 2 projects. The first project (CLSLibrary) is a Class Library that contains public class User. The second project (CLSTester) is an ASP.NET Web Application that contains a Web Form (CLSTestForm.aspx). The code-behind file of the Web Form has reference to CLSLibrary and a 'using CLSLibrary' directive, so it can use the User class. The CLSLibrary compiles without errors. However, running the CLSTestForm generates...
4
1968
by: Alan Silver | last post by:
Hello, I'm trying to use an ArrayList to do data binding, but am getting an error I don't understand. I posted this in another thread, but that was all confused with various other problems, which could be why no-one answered it!! I've now narrowed the problem down, so am starting a new, more specific, thread. Sorry it's a bit long, but it's reasonably simple stuff. I have a page where I'm showing product details, including any
17
2211
by: Jef Driesen | last post by:
Suppose I have a datastructure (actually it's a graph) with one template parameter (the property P for each edge and vertex): struct graph<P>; struct vertex<P>; struct edge<P>; I also have an algorithm that modifies this datastructure. The basic outline of the algorithm is independent of the type of property. So I implemented a generic version of the algorithm and a function object for
8
8929
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then throws up the following error in the browser: CS1061: 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Web' and no extension method 'Web' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found...
1
2161
by: Nilam2477 | last post by:
I have a solution containing about 5 projects. One of these is "CommonClass" witch contains a class User with a public property ReportName. In my web site i check this property on an user object (if (usr.ReportName) ...) Intellisens works on the property, and when i right click and "go to definition" i go to the correct file and definiton. However when i build i get the following error: 'Project.CommonClass.User' does not contain a...
0
7946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7877
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8253
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8240
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1482
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1216
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.