473,408 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Cannot add property into Class when implementing ICollection interface

Hi All,

I have a very nice problem to be solved!!!

I am developing a Control which contains other controls and Templates
in it.

Following is the snippet of the code in .aspx file:
-------------------------------------------------------------------------------------------------------------------------------
<asp:Repeater ID="rptrMain" runat="server" DataSourceID="AssetDS">
<ItemTemplate>
<emotion:AssetView ID="AssetView1" runat="server"
TemplateIndex="1"
MyDataSource="<%# Container.DataItem %>">
<Area Index="1">
<em:Field runat="server" ID="Item" Text="Item: "
Value="Item"></em:Field>
<em:Field runat="server" ID="AssetName"
Text="Name: "
Value="Name"></em:Field>
<em:Field runat="server" ID="Category"
Text="Category: "
Value="Category"></em:Field>
</Area>
</emotion:AssetView>
</ItemTemplate>

</asp:Repeater>
-------------------------------------------------------------------------------------------------------------------------------
Code Explanation: Please find <Area Index="1>... tag in the above code.
Where <Areatag is the collection of "FieldCollection" Class.

The "FieldCollection" Class is defined as:
public class FieldCollection : Control, ICollection
{
public FieldCollection()
{
_list = new Collection<Field>();
}

private int _index;
public int Index
{
get { return _index; }
set { _index = value; }
}
...........
...........
........... // ICollection properties implemented.
}

Now the PROBLEM IS: The .Net parser could not find the property (namely
'Index') of the <Areatag and gives the following error generated:
-------------------------
Parser 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: Property 'Area' does not have a property named
'Index'.
---------------------------

Could anybody find the solution to this? Please let me know if you
have.

Thanks in advance.

Regards,
Pinkesh.

Jan 12 '07 #1
0 2006

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: hman | last post by:
Hi, I have a collection class where I've implemeneted the ICollection Interface. Here is a small code segment. public class PageList : ICollection, IComparer, IEnumerable, IList {
8
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 {
5
by: Jimski | last post by:
Hi, I am creating a model to navigate a tree of symbols and links. My main purpose of this post is to ascertain the quickest way of navigating the tree. There are two ways that I am considering,...
4
by: C.E.O. Gargantua | last post by:
I want to have a member property that is common to a set of classes. I designed an abstract class, but when I try to add it to the abstract class, it flags an error in VS.NET. The design (...
4
by: Patrick.O.Ige | last post by:
When i try to do paging in Datagrid why do i get the error:- System.Web.HttpException: Cannot compute Count for a data source that does not implement ICollection.?
2
by: larzeb | last post by:
I receive the following error from the compiler: ScheduledInfo' must implement 'Property AddrLine1() As String' for interface 'ICASSBatch'. Implementing property must have matching...
0
by: Pinkesh | last post by:
Hi All, I have a very nice problem to be solved!!! I am developing a Control which contains other controls and Templates in it. Following is the snippet of the code in .aspx file:...
9
by: Paul | last post by:
Hi, I feel I'm going around circles on this one and would appreciate some other points of view. From a design / encapsulation point of view, what's the best practise for returning a private...
4
by: xke | last post by:
Why the collection property is not included in the ouput serialization ? I have a custom generic collection (implements icollection): Events of objects: Event. Event is a simple class...
6
by: GiJeet | last post by:
hello, I'm trying to use a dictionary as a class member. I want to use a property to get/set the key/value of the dictionary but I'm confused as how to use a dictionary as a property. Since there...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.