Can anyone point me in the right direction.

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
 
C

Cowboy \(Gregory A. Beamer\)

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!
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top