Repeater.ItemTemplate =?

Discussion in 'ASP .Net' started by Shimon Sim, Jan 27, 2005.

  1. Shimon Sim

    Shimon Sim Guest

    Can I dynamically create ItemTemplate for Repeater control?

    I want to do something like this in code
    repeater.ItemTemplete=...something that will display in repeater.
    I don't know what I can assign and if it at all possible.

    Thanks,
    Shimon.
    Shimon Sim, Jan 27, 2005
    #1
    1. Advertising

  2. Shimon Sim

    Karl Seguin Guest

    Shimon:
    Yes you can via the Page.LoadTemplate function. It behaves a lot like
    LoadControl but can be assigned, as you want, to the ItemTemplate (or any
    other template)

    repater.ItemTemplate = Page.LoadTemplate("someTemplate.ascx")

    There are a number of resources online, such as:
    http://www.aspdotnetheaven.com/Code/Jan2003/DynamicTemplate.asp , you might
    also wanna check out http://www.123aspx.com/redir.aspx?res=31926 or simply
    do a google search for Page.LoadTemplate or dynamic templates

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Shimon Sim" <> wrote in message
    news:...
    > Can I dynamically create ItemTemplate for Repeater control?
    >
    > I want to do something like this in code
    > repeater.ItemTemplete=...something that will display in repeater.
    > I don't know what I can assign and if it at all possible.
    >
    > Thanks,
    > Shimon.
    >
    >
    Karl Seguin, Jan 27, 2005
    #2
    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. Bennett Haselton
    Replies:
    1
    Views:
    5,321
    Joe Fallon
    Sep 24, 2004
  2. Replies:
    3
    Views:
    1,570
    Eliyahu Goldin
    Aug 16, 2005
  3. Mike
    Replies:
    1
    Views:
    601
    Alec MacLean
    Feb 4, 2006
  4. Sachin
    Replies:
    1
    Views:
    1,177
    sloan
    Feb 21, 2006
  5. Gibs
    Replies:
    0
    Views:
    2,209
Loading...

Share This Page