Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Big Daddy #1
Can a repeater's ItemTemplate instantiate derived classes?
I posted this in a different group yesterday with no responses, so I'll
try here.
I would like to have a repeater class like this:
<asp:Repeater ID="CriteriaRepeater" runat="server" >
<ItemTemplate>
<uc1:BaseControl ID="BaseControl1" BindData='<%#
Container.DataItem %>' runat="server" />
</ItemTemplate>
</asp:Repeater>
The thing that is getting repeated for each item in the datasource is a
user control that is a base class. I would like it to actually create
different controls that are devired from the base control, depending on
the values in the datasource. For example, if there are three classes
derived from BaseControl1 (DerivedControl1, DerivedControl2,
DerivedControl3), if the datasource has three records, the repeater
would be able to create one instance of each of the derived classes
rather than three instances of the base class. Is this possible?
Thanks in advance,
John
Big Daddy Guest
-
#39713 [NEW]: Static variables defined in static methods duplicated in derived classes
From: paul at digitalbacon dot us Operating system: Linux, Mac OS X 10.4, Windows XP PHP version: 5.2.0 PHP Bug Type: ... -
Problm with Repeater's ordering
Hi! I have a Repeater, with a HTTPService dataProvider. The resulting XML has XML references (attached). The ordering of the data isn't the same... -
Design time support for classes derived from DataGridColumn
How to get design time support for classes derived from DataGridColumn ? I have created new DataGridColumn type, it uses image from database as... -
exposing derived classes to proxy without fake webmethod?
Hi, try using on the appropriate WebMethod. This attribute instructs the ASMX engine to include the type description for type bla. Cheers, --... -
Serializing classes derived from dataset
Hi, I am trying to store various objects within session. Due to the site being hosted in a web farm we are going to have to use either State... -
John Saunders #2
Re: Can a repeater's ItemTemplate instantiate derived classes?
"Big Daddy" <johngilmer@yahoo.com> wrote in message
news:1161964037.400941.247310@m73g2000cwd.googlegr oups.com...It's possible if you write it. ;-)>I posted this in a different group yesterday with no responses, so I'll
> try here.
>
> I would like to have a repeater class like this:
>
> <asp:Repeater ID="CriteriaRepeater" runat="server" >
> <ItemTemplate>
> <uc1:BaseControl ID="BaseControl1" BindData='<%#
> Container.DataItem %>' runat="server" />
> </ItemTemplate>
> </asp:Repeater>
>
> The thing that is getting repeated for each item in the datasource is a
>
> user control that is a base class. I would like it to actually create
> different controls that are devired from the base control, depending on
>
> the values in the datasource. For example, if there are three classes
> derived from BaseControl1 (DerivedControl1, DerivedControl2,
> DerivedControl3), if the datasource has three records, the repeater
> would be able to create one instance of each of the derived classes
> rather than three instances of the base class. Is this possible?
You would need to create a composite control which decided on its child
control(s) based on the data source. Put it inside of the repeater, data
bind it, and you're all set.
John
John Saunders Guest



Reply With Quote

