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.