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. Html in Class Files....Does it make sense....

Html in Class Files....Does it make sense....

Scheduled Pinned Locked Moved ASP.NET
htmldatabasedesignbusinesstutorial
3 Posts 3 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.
  • A Offline
    A Offline
    Amit Kumar G
    wrote on last edited by
    #1

    Hi All Can anyone guide me is the below approach is correct or not.... I am writing my max html code in my class file (Business layer) and return simple string to presentation layer. Normally i am doing this type of coding where i need my html to be build on the basis of return values from database. E.g. I want to show hyperlink on a page if count(*) from table is greater than zero otherwise display “Not Available”. So my coding apprach is as below strheader = "

    " + "More Images" + "**
    " sProdDescString3 = sProdDescString3 + strheader If PrdMoreImageDataTable.Rows.Count = 0 Then sProdDescString3 = sProdDescString3 + "Not Available" Else sProdDescString3 = sProdDescString3 + "Show Me" And in UI layer do simply as <%= sProdDescString3%> on appropriate location Please guide me, is this approach is correct or some ……( Amit**

    G A 2 Replies Last reply
    0
    • A Amit Kumar G

      Hi All Can anyone guide me is the below approach is correct or not.... I am writing my max html code in my class file (Business layer) and return simple string to presentation layer. Normally i am doing this type of coding where i need my html to be build on the basis of return values from database. E.g. I want to show hyperlink on a page if count(*) from table is greater than zero otherwise display “Not Available”. So my coding apprach is as below strheader = "

      " + "More Images" + "**
      " sProdDescString3 = sProdDescString3 + strheader If PrdMoreImageDataTable.Rows.Count = 0 Then sProdDescString3 = sProdDescString3 + "Not Available" Else sProdDescString3 = sProdDescString3 + "Show Me" And in UI layer do simply as <%= sProdDescString3%> on appropriate location Please guide me, is this approach is correct or some ……( Amit**

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      All HTML code should be in the presentation layer, not in the business layer.

      --- b { font-weight: normal; }

      1 Reply Last reply
      0
      • A Amit Kumar G

        Hi All Can anyone guide me is the below approach is correct or not.... I am writing my max html code in my class file (Business layer) and return simple string to presentation layer. Normally i am doing this type of coding where i need my html to be build on the basis of return values from database. E.g. I want to show hyperlink on a page if count(*) from table is greater than zero otherwise display “Not Available”. So my coding apprach is as below strheader = "

        " + "More Images" + "**
        " sProdDescString3 = sProdDescString3 + strheader If PrdMoreImageDataTable.Rows.Count = 0 Then sProdDescString3 = sProdDescString3 + "Not Available" Else sProdDescString3 = sProdDescString3 + "Show Me" And in UI layer do simply as <%= sProdDescString3%> on appropriate location Please guide me, is this approach is correct or some ……( Amit**

        A Offline
        A Offline
        Avanika Gupta
        wrote on last edited by
        #3

        Yes it makes sense. One way to achieve is using span element in the presentation layer and then setting the InnerHtml property in class file according to the condition. e.g. this.objSpan.InnerHtml = "

        ";

        Thanks, Avanika

        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