J
j_a5
Hi,
I have a custom user control. In that custom control MyControl. I am
exposing a property called MyItems. The MyItems is a
strongly typed collection of MyItem. I am exposing a MyItems in the user
control as a public property. I want to be able to add items to the MyItems
collection at design time, i.e., I want to specify something like this in my
aspx page.
<uc1:MyCustomControl1 id="MyCustomControl1" runat="server>
<MyItems>
<MyItem Text = "text">
<MyItem Text = "text2">
</MyItems>
</uc1:MyCustomControl1>
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: CS1502: The best overloaded method match for
'ASPNetTest.MyItems.Add(ASPNetTest.MyItem)' has some invalid arguments
When I looked at the complete compilation source, It looks like it creates
as Htmlgenericcontrol with a tagname of MyItem. How
Can some one help me how to go about exposing a collection as a public
property in user control that can be set at design time.
Thanks in advance,
j_a5
I have a custom user control. In that custom control MyControl. I am
exposing a property called MyItems. The MyItems is a
strongly typed collection of MyItem. I am exposing a MyItems in the user
control as a public property. I want to be able to add items to the MyItems
collection at design time, i.e., I want to specify something like this in my
aspx page.
<uc1:MyCustomControl1 id="MyCustomControl1" runat="server>
<MyItems>
<MyItem Text = "text">
<MyItem Text = "text2">
</MyItems>
</uc1:MyCustomControl1>
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: CS1502: The best overloaded method match for
'ASPNetTest.MyItems.Add(ASPNetTest.MyItem)' has some invalid arguments
When I looked at the complete compilation source, It looks like it creates
as Htmlgenericcontrol with a tagname of MyItem. How
Can some one help me how to go about exposing a collection as a public
property in user control that can be set at design time.
Thanks in advance,
j_a5