Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 2nd, 2005, 12:46 AM
Registered User
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Display or Hide Recordset Data

I am trying to allow, via the admin section, the ability to change the background colours of a table.
The problems I am having is as follows;
- I have 4 of these sections on a dynamic template page
- not all the sections are used each time the template is called
- I want to either make the colours default to a specific colour if used or if not used, then to display a set colour

I see 2 ways for this to happen;
1 - if statements for the colours
- or -
2 - SQL statement to disallow the table to be shown unless content is posted in the database

I am new to SQL and 'if' statements.
I am using dreamweaver MX 2004 with access 2000.

This is the code want to be able to hide, I have 4 of these section on a page.
Code:


Code:
<table width="150" border="0" cellpadding="1" cellspacing="0" bgcolor="#<%=(rs_pages.Fields.Item("S_SideHeading4_ColourBG").Value)%>">
            <tr>
              <td>
            <table width="150"  border="0" cellspacing="0" cellpadding="4">
                  <tr>
                    <td align="center" bgcolor="#<%=(rs_pages.Fields.Item("S_SideHeading4_ColourBG").Value)%>"><strong><%=(rs_pages.Fields.Item("S_SideHeading4").Value)%></strong></td>
                  </tr>
                  <tr>
                    <td bgcolor="#<%=(rs_pages.Fields.Item("S_SideContent4_ColourBG").Value)%>">
            <%Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
            objFile = Request.ServerVariables("SCRIPT_NAME")
            ImagePath = Server.MapPath("../site_images\")
            ImagePath = ImagePath & "\" & (rs_pages.Fields.Item("S_SideImage4").Value)
            If objFileSystem.FileExists(ImagePath) then%>
            <img src="../site_images/<%=(rs_pages.Fields.Item("S_SideImage4").Value)%>" alt="ADC KRONE" border="0" align="right" /><%=(rs_pages.Fields.Item("S_SideHeading4").Value)%> 
            <%End If%>

            <%= CI_Preserve((rs_pages.Fields.Item("S_SideContent4").Value)) %>
                    </td>
                  </tr>
              </table>
      </td>
    </tr>
</table>
The speed of light is faster than the speed of sound. Thats why some people look good before they speak.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional display/hide of images bertvanpet Crystal Reports 0 May 25th, 2007 02:37 AM
IF recordset value =something then HIDE? waynelambright ASP.NET 1.0 and 1.1 Basics 5 October 30th, 2006 01:53 PM
Tab item display prob / hide TABS query socoolbrewster CSS Cascading Style Sheets 4 June 13th, 2006 12:59 PM
Display/hide layers sstian99 Javascript How-To 1 September 9th, 2004 06:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.