Can anyone point me in the right direction.

  • Thread starter Thread starter Marc Bishop
  • Start date Start date
M

Marc Bishop

Hi all,
i want to display a list of specifications but only want them to be
displayed if
the returned value from the database is not "".
the only way i could think of was
If height <> "" then
showspec = showspec + "<TR><TD>specHeight</TD><TD>" & height & "</TD></TR>"
end if

but this is a really had way of doing it (mixing design with logic)
can anyone maybe give me a clue to a better way to do it?

thanks in advance :)

marc
 
There are a couple of ways I can think of:

1. Use a repeater. Not the most elegant solution, but easy to bind. You can
find how to set up conditional logic in other threads (groups.google.com is
your friend) :-)

2. Make a routine to create the table and bind to the page:

<%# =CreateTable() %>

CreateTable() can return nothing if there is no data.

3. Add a container to the page and bind a table to the container
programatically. An easy container to use is a Panel. You then create the
table and bind using:

PanelName.Controls.Add(TableControlName)

Once again, you can NOT build the table if there is no data.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Back
Top