Print Page | Close Window

Problem With Displaying Information

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=15900
Printed Date: 30 March 2026 at 5:05am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Problem With Displaying Information
Posted By: Misty
Subject: Problem With Displaying Information
Date Posted: 20 July 2005 at 1:43am
I am having a problem with displaying information. I believe that it's a problem with the table. Please look at http://www.themacedoniachurch.org/staff2.asp. - http://www.themacedoniachurch.org/staff2.asp. Look at how the buttons and header are displayed every time a record is displayed. I believe that there's a typo somewhere in my code. Can someone please help me? I'd like for it to look something like http://www.madisonheightsbaptist.org/staff.asp - http://www.madisonheightsbaptist.org/staff.asp .
 
Here's my code:
 
'Start sql string
      sqlString = "select * from MMBCStaff Order by StaffID"
                &nbs p; 
      'Create the recordset
      set rs = Server.CreateObject("ADODB.Recordset")
      rs.Open sqlString, connectionString, adOpenDynamic, adLockOptimistic
    
      'Set the current record pointer to the first record of the recordset
      rs.MoveFirst
     
      'Loop through all the records in the recordset
      while not rs.EOF
          
      'Get values for local variables
     
      StaffName = rs("Name") & ""
      Position = rs("Title") & ""
      Email = rs("Email") & ""
      Bio = rs("Bio") & ""
 
%>
<html>
<head>
<title>About Us</title>
<!--#include file="Include_Buttons.asp"--></td>
    <td rowspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <!--DWLayoutTable-->
        <tr>
          <td width="9" height="1320">&nbsp;</td>
          <td width="529" valign="top"> <p><strong><font size="6">Our Staff</font></strong></p>
            <%
            If Email <> "" then
            %>
   <font face="Arial, Helvetica, sans-serif" size=3><a href="
mailto:<% - mailto:<% = Email %>"><%= StaffName %></a>,&nbsp;<b><%= Position %></font></b>
       <% else %>
    <font face="Arial, Helvetica, sans-serif" size=3><%= StaffName %>,&nbsp;<b><%= Position %></b></font>
    <% end if %>
      <%     
  rs.MoveNext
        wend
%>
   <p>&nbsp;</p>
            <p><br>
            </p>
            </td>
        </tr>
        <tr bgcolor="#CCCC99">
          <td height="68" colspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="687" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <!--DWLayoutTable-->
        <tr>
          <td width="201" height="619">&nbsp;</td>
        </tr>
        <tr>
          <td height="68" valign="top" bgcolor="#CCCC99"><!--DWLayoutEmptyCell-->&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="52">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
'Close the recordset and connection string
rs.Close
set rs = Nothing
set ConnectionString = Nothing
%>



Replies:
Posted By: dpyers
Date Posted: 20 July 2005 at 10:55am
staff2.asp is 404.
Using Option Explicit will help id asp typos.
Good way to spot html code errors is the w3c validator.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Misty
Date Posted: 20 July 2005 at 1:13pm
I have Option Explicit. I don't understand why you are seeing a 404 error. It shows fine for me. I am just unhappy with the way the tables are showing.


Posted By: Gullanian
Date Posted: 20 July 2005 at 1:43pm
The link includes a . after the asp extension.


Posted By: dpyers
Date Posted: 20 July 2005 at 3:06pm
Ahhh...
The page looks "interesting"

The problem is where you've positioned the beginning and ending statements for the loop. Basically, you're putting multiple html pages into one doc by writing all the html within each iteration of the loop. Do a view source and search for html and you'll se what I mean.

I think that what you mean to do is to put the beginning and ending asp statements around just this code:

  <%
            If Email <> "" then
            %>
   <font face="Arial, Helvetica, sans-serif" size=3><a href="
mailto:%3C% - mailto:<% = Email %>"><%= StaffName %></a>,&nbsp;<b><%= Position %></font></b>
       <% else %>
    <font face="Arial, Helvetica, sans-serif" size=3><%= StaffName %>,&nbsp;<b><%= Position %></b></font>
    <% end if %>
      <%     
  rs.MoveNext
        wend
%>
   <p>&nbsp;</p>
            <p><br>
            </p>



-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net