PC Review


Reply
Thread Tools Rate Thread

Cannot add property into Class when implementing ICollection interface

 
 
Pinkesh
Guest
Posts: n/a
 
      12th Jan 2007
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 <Area> tag 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 <Area> tag 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot add property into Class when implementing ICollection interface Pinkesh Microsoft ASP .NET 0 12th Jan 2007 10:30 AM
Implementing interface in class created with CodeDOM =?Utf-8?B?U2ViYXN0aWVuIFJBSUxMQVJE?= Microsoft Dot NET Framework 0 19th Sep 2005 08:30 AM
Error in implementing interface Property larzeb Microsoft VB .NET 2 30th Mar 2005 03:24 PM
Re: Class gets loaded but not able to cast it to an implementing Interface Jon Skeet [C# MVP] Microsoft C# .NET 0 5th Jun 2004 10:28 PM
C# class not implementing VB.NET interface =?Utf-8?B?UGF1bA==?= Microsoft Dot NET 5 18th Jan 2004 10:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:45 AM.