Last post Apr 06, 2011 12:26 AM by chricholson
Apr 05, 2011 01:08 PM|chricholson|LINK
I am writing some pages in ASP.NET VB. Based on some database results I need certain pieces of information to display, basically if a column is not null then write out <p>database value</p>. So far, all the databse connection is called in my .aspx.vb file.
Rather than have an asp:label (which creates a <span> not a <p> anyway) I was hoping I could keep all my HTML markup front end, so have some ASP Classic code that looks like:
if results.item("name").value <> "" then
response.write("<p>" + results.item("name").value + "</p>"
The problem with this of course is results is not accessible from the front end.
Possibly this is the wrong approach, maybe someone can suggest an alternative if there are better ways. However, I don't like relying solely on Labels, Panels and other built in elements which create spans, divs, etc respectively.
is a very poor way of doing things so would prefer to be able to write out exactly when I want it without any unexpected markups.
Apr 06, 2011 12:26 AM|chricholson|LINK
Ok scrap that, I've worked it out.
For anyone interested it involved creating a bunch of public variables as the top of the page which I then fill while using my SQL data reader and then can access from the front end ASP Classic code.