473,657 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="A ssetDS">
<ItemTemplate >
<emotion:AssetV iew ID="AssetView1 " runat="server"
TemplateIndex=" 1"
MyDataSource="< %# Container.DataI tem %>">
<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:AssetVi ew>
</ItemTemplate>

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

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

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 876

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

Similar topics

3
4263
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
6006
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
4210
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, see below. I am unsure why you would implement interfaces in this design? Is it a performance issue? Simple method -------------
4
3604
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
6785
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 'ReadOnly'/'WriteOnly' specifiers. The interface: Public Interface ICASSBatch Property AddrLine1() As String Property BarCode() As String
0
2019
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: ------------------------------------------------------------------------------------------------------------------------------- <asp:Repeater ID="rptrMain" runat="server" DataSourceID="AssetDS">
9
7877
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 List<as a property. Consider the example below, the class "ListTest" contains a private "List<>" called "strings" - it also provides a public method to add to that list,
4
1455
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 exposing, let's say, one property: name Public Class Event <XmlAttribute("name")_
6
10171
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 are 2 parts, I don't know how to setup the get/sets. I tried searching but could not find any examples. I'd appreciate an example of how to get/ set the two parts of a dictionary via a property of a class. tia
0
8411
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
8323
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
8739
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...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6176
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
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
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.