Displaying text of different types in a webcontrol

Discussion in 'ASP .Net Web Controls' started by Novice, May 28, 2004.

  1. Novice

    Novice Guest

    Hey all, I am wondering if anyone has an opinion as to which webcontrol would be best suited to display sections of data that may be just a regular paragraph, a bullet or a numbered list item

    So in my database I have a table that contains text for one attribute. In another attribute there is an indicator of how to display that text - i.e. as a paragraph, a bullet, etc

    If I had these three separate records/rows in that table
    pKey | text | type_of_text |(more attributes here that establis
    ------------------------------------------------------------------------------------------------ the relationship between each of
    1 | This is all the ways that you could go fishing: | paragraph |the records/rows in this table
    2 | Use a net | bullet
    3 | Use a fishing rod | bullet

    Since repeater is the most flexible it seems likely that I should use a repeater web control - however, would I have to programmatically determine the type of the record/row and then generate the HTML for each record? Or could I use some feature of an existing web control that I could map each of the various possible types for the text to each record row - i.e. something like this in the .aspx file

    <asp:Repeater><ItemTemplate (if %#Container.DataItem("type_of_text") = bullet%)><ul><li><%#Container.DataItem("text")%></ul></ItemTemplate

    -------------------------------------
    Or am I better off just writing a loop in the .Net code and creating the appropriate html depending on the type_of_text

    Any ideas

    Thanks
    Novice
     
    Novice, May 28, 2004
    #1
    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. Guest
    Replies:
    2
    Views:
    748
  2. John Smith
    Replies:
    1
    Views:
    298
    Kaz Kylheku
    Oct 10, 2005
  3. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    210
    Luis Ramírez
    Jul 6, 2004
  4. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    205
    Kasabaarde Sumta
    Dec 13, 2004
  5. subha
    Replies:
    16
    Views:
    226
    Tad McClellan
    Jan 28, 2006
Loading...

Share This Page