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