Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Wich control to use and how to show the content from db

Wich control to use and how to show the content from db

Scheduled Pinned Locked Moved ASP.NET
questiondatabasehtmltutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Priya Prk
    wrote on last edited by
    #1

    Dear all, I need your advice in this. The admin of my site can make some articles with images with the html editor and saves the html into the database. now i want to show the list of articles with the date added, sender, and a short part of the article(depending on the saved html, this can be text with maybe a image). ofter clicking a article, the user can see the entire article. my question is, what is the best way to do this? wich control to use to list the articles, and how can i show only a part of the article that can also contain a image in that list ? Thanks in advance.

    T 1 Reply Last reply
    0
    • P Priya Prk

      Dear all, I need your advice in this. The admin of my site can make some articles with images with the html editor and saves the html into the database. now i want to show the list of articles with the date added, sender, and a short part of the article(depending on the saved html, this can be text with maybe a image). ofter clicking a article, the user can see the entire article. my question is, what is the best way to do this? wich control to use to list the articles, and how can i show only a part of the article that can also contain a image in that list ? Thanks in advance.

      T Offline
      T Offline
      T M Gray
      wrote on last edited by
      #2

      A Repeater or a DataList should be good for what you are trying to do. You just have to define the template with labels, image controls and maybe an html literal control. As far as displaying part of the article, since it is stored as html that makes it much more difficult. Unless you have some standards in terms of how the html is formatted, it will be difficult to pull a html fragment that renders properly. For instance if the article html uses nested divs and you only pull enough text that you leave off the closing div tags it would be a mess.

      P 1 Reply Last reply
      0
      • T T M Gray

        A Repeater or a DataList should be good for what you are trying to do. You just have to define the template with labels, image controls and maybe an html literal control. As far as displaying part of the article, since it is stored as html that makes it much more difficult. Unless you have some standards in terms of how the html is formatted, it will be difficult to pull a html fragment that renders properly. For instance if the article html uses nested divs and you only pull enough text that you leave off the closing div tags it would be a mess.

        P Offline
        P Offline
        Priya Prk
        wrote on last edited by
        #3

        Hi T M Gray, Thank you for the response. Can you tell me what is then the right and simple way to do this?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups