Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Need to show a list of controls on the page

Reply
Thread Tools

Need to show a list of controls on the page

 
 
Cyril Gupta | सिरिल गुप्ता
Guest
Posts: n/a
 
      04-07-2008
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

 
Reply With Quote
 
 
 
 
Lloyd Sheen
Guest
Posts: n/a
 
      04-07-2008

"Cyril Gupta | सिरिल गुप्ता" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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

 
Reply With Quote
 
 
 
 
Cyril Gupta | सिरिल गुप्ता
Guest
Posts: n/a
 
      04-09-2008
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Cyril Gupta | सिरिल गुप्ता" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Controls.Count, Controls.IsSynchronized, and Controls.SyncRoot Nathan Sokalski ASP .Net 4 09-05-2007 03:27 AM
Show/Hide Multiple User Controls on Page vcuankitdotnet ASP .Net 2 05-17-2007 12:13 AM
WEB controls do not show on the web page Doru Roman ASP .Net Web Controls 2 01-06-2006 11:54 PM
List Controls on Datagrid will not show Selection after Postback Joanne ASP .Net 2 07-07-2005 01:46 PM
Trouble referencing controls within list controls 2obvious ASP .Net 0 09-13-2004 10:38 PM



Advertisments