Need to show a list of controls on the page

Discussion in 'ASP .Net' started by Cyril Gupta | सिरिल गà¥à¤ªà¥à¤¤à¤¾, Apr 7, 2008.

  1. 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
     
    Cyril Gupta | सिरिल गà¥à¤ªà¥à¤¤à¤¾, Apr 7, 2008
    #1
    1. Advertising

  2. Cyril Gupta | सिरिल गà¥à¤ªà¥à¤¤à¤¾

    Lloyd Sheen Guest

    "Cyril Gupta | सिरिल गà¥à¤ªà¥à¤¤à¤¾" <> wrote in message
    news:...
    > 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
     
    Lloyd Sheen, Apr 7, 2008
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    >
    > "Cyril Gupta | सिरिल गà¥à¤ªà¥à¤¤à¤¾" <> wrote in message
    > news:...
    >> 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
     
    Cyril Gupta | सिरिल गà¥à¤ªà¥à¤¤à¤¾, Apr 9, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt

    TO show or NOT to show

    Matt, May 2, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    401
  2. Joanne
    Replies:
    2
    Views:
    654
    Joanne
    Jul 7, 2005
  3. Disco Octopus

    to show image or to show flash

    Disco Octopus, May 13, 2004, in forum: HTML
    Replies:
    7
    Views:
    2,449
    Toby A Inkster
    May 14, 2004
  4. vcuankitdotnet

    Show/Hide Multiple User Controls on Page

    vcuankitdotnet, May 16, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    568
    =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=
    May 17, 2007
  5. Doru Roman

    WEB controls do not show on the web page

    Doru Roman, Jan 4, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    121
    Steve C. Orr [MVP, MCSD]
    Jan 6, 2006
Loading...

Share This Page