Re: Need to show a list of controls on the page



Hello Lloyd,

Thank you for the tip. Using a collection to databind is a good idea.

Meanwhile I've re-invented the wheel... I created a asp.net control to hold my template, and then added a number of these controls to a panel.

Guess using a repeated is much easier! I will just check if I should trash my code :)

Thanks
Cyril Gupta

"Lloyd Sheen" <a@xxx> wrote in message news:et9SkaNmIHA.536@xxxxxxxxxxxxxxxxxxxxxxx

"Cyril Gupta | सिरिल गुप्ता" <cyrilgupta@xxxxxxxxx> wrote in message news:864443B3-4B57-452E-A575-DD195AE1A946@xxxxxxxxxxxxxxxx
Hello,

I have an interesting problem.

I wish to show a set of controls on a form repeatedly. Sort of like an ASP.Net repeated, but without any data binding (I want to be able to put in the data myself.

Basically, I am making a website which takes an RSS feed, and shows a list of posts in the feed. Like Google reader. I want to to use ASP.Net Ajax controls in the content, so I can't make a loop and spew pure HTML. I need to use the actual controls, with the events and everything, and I don't want to put in 50 controls on the form.

Is there any way to put all those controls on the form through code, automatically?

Thank for any leads/ideas that you can give me.

Regards
Cyril

Use a repeater. Within the repeater you will define the set of controls for each post. You then create a collection of posts from the RSS feed and databind that collection to the repeater. You can use the <%# Eval("Name") %> format in the controls within the repeater but I find that handling the ItemDataBound event will allow more flexibilty.

There is a starter kit which has a module for RSS feeds http://www.codeplex.com/ASPNETPortal which might get you started.

Hope this helps
LLoyd SHeen

.



Relevant Pages

  • Re: Dynamic DB lookup/eval to serve a user control bound to a repeater
    ... attached to ImageRepeater is intended to tell the repeater what ContentIDs ... "ImageBox" controls, another control I've made. ... initializing and databinding sequence in ASP.NET page. ... usercontrol defined in Repeater's ItemTemplate, ...
    (microsoft.public.dotnet.framework.aspnet)
  • =?iso-8859-1?q?Server_Controls_dynamisch_zu_einem_Repeater_hinzuf=FCgen?=
    ... ich versuche, zur Laufzeit Controls zu einem UserControl, das von einem ... Repeater abgeleitet ist, hinzuzufügen. ... Ausserdem eine ItemTemplate class für das repeater control: ... container) füge ich zum container in einer Schleife: ...
    (microsoft.public.de.german.entwickler.dotnet.asp)
  • Re: Repeating section control in ASP.NET
    ... > I did this with a DataGrid control and a custom collection. ... He was talking about a group of controls ... >> You could create a DataSet and a Repeater. ... >> have a blank row and it will display the same template as your populated ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Repeating section control in ASP.NET
    ... > I did this with a DataGrid control and a custom collection. ... He was talking about a group of controls ... >> You could create a DataSet and a Repeater. ... >> have a blank row and it will display the same template as your populated ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Need to show a list of controls on the page
    ... I want to to use ASP.Net Ajax controls in the content, so I can't make a loop and spew pure HTML. ... Within the repeater you will define the set of controls for each post. ... You then create a collection of posts from the RSS feed and databind that collection to the repeater. ... There is a starter kit which has a module for RSS feeds http://www.codeplex.com/ASPNETPortal which might get you started. ...
    (microsoft.public.dotnet.framework.aspnet)