Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 10th, 2004, 03:22 AM
kishorebudha kishorebudha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 kishorebudha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP -- formatting/display first record differently

I am an amateur programmer, developing my own personal site. I have been picking up ASP, ADO, SQL, VBScript bit by bit over the last two weeks and learning has been mostly through trial and errors.

How do I apply a different formatting to the first headline of the recordset. I have already created the necessary classes in the stylesheet.

<%rs.MoveFirst
do while not rs.eof
' Writes the links to the newly created pages in the browser
response.write "<a href='" & rs("ID") & "_" & "features" & month(date) & "_" & year(date) & ".htm'>" & "<p class='menuhead2'>" & rs("Headline") & "</p>" & "</a>" & "<p class='menuintro'>" & rs("Blurb") & "</p>"
rs.movenext
loop
%>

Reply With Quote
  #2  
Old September 13th, 2004, 04:20 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
Hi

Try:
Code:
<%
int_Counter = 0
rs.MoveFirst
do while not rs.eof
' Writes the links to the newly created pages in the browser
If int_Counter = 0 Then
' First row -- do something to format the line here
End If
response.write "<a href='" & rs("ID") & "_" & "features" & month(date) & "_" & year(date) & ".htm'>" & "<p class='menuhead2'>" & rs("Headline") & "</p>" & "</a>" & "<p class='menuintro'>" & rs("Blurb") & "</p>"
int_Counter = int_Counter + 1
rs.movenext
loop
%>

Reply With Quote
  #3  
Old September 13th, 2004, 07:05 AM
kishorebudha kishorebudha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 kishorebudha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Many thanks for responding. I resolved it with the following:

'WRITE FIRST HEADLINE WITH SPECIAL FORMATTING
rs.Movefirst
act.WriteLine(" <p class='byline'>" & rs("section") & "</p>" )
act.WriteLine(" <p class='menuhead1'>" & rs("Headline") & "</p>" )
act.WriteLine(" <p class='menuintro1'>" & rs("Blurb") & " | " & "<a href='" & rs("ID") & "_" & "topstory" & month(date) & "_" & year(date) & ".html'>" & "Read</a></p>")
rs.Movenext
'WRITE SUBSEQUENT HEADLINEs WITH DIFFERENT FORMATTING
do while not rs.eof
act.WriteLine(" <p class='byline'>" & rs("section") & "</p>" )
act.WriteLine(" <p class='menuhead2'>" & rs("Headline") & "</p>" )
act.WriteLine(" <p class='menuintro'>" & rs("Blurb") & " | " & "<a href='" & rs("ID") & "_" & "topstory" & month(date) & "_" & year(date) & ".html'>" & "Read</a></p>")
rs.movenext
loop


Best regards



Quote:
Originally Posted by selwonk
Hi

Try:
Code:
<%
int_Counter = 0
rs.MoveFirst
do while not rs.eof
' Writes the links to the newly created pages in the browser
If int_Counter = 0 Then
' First row -- do something to format the line here
End If
response.write "<a href='" & rs("ID") & "_" & "features" & month(date) & "_" & year(date) & ".htm'>" & "<p class='menuhead2'>" & rs("Headline") & "</p>" & "</a>" & "<p class='menuintro'>" & rs("Blurb") & "</p>"
int_Counter = int_Counter + 1
rs.movenext
loop
%>

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > ASP -- formatting/display first record differently


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT