Here some code and a tutorial on how to create a nested repeat region in ASP:-
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="../../Connections/connDN.asp" --> <% Dim rsNewsletter Dim rsNewsletter_numRows Set rsNewsletter = Server.CreateObject("ADODB.Recordset") rsNewsletter.ActiveConnection = MM_connDN_STRING rsNewsletter.Source = "SELECT * FROM tblNewsletter ORDER BY NLID ASC" rsNewsletter.CursorType = 0 rsNewsletter.CursorLocation = 2 rsNewsletter.LockType = 1 rsNewsletter.Open() rsNewsletter_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 rsNewsletter_numRows = rsNewsletter_numRows + Repeat1__numRows %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Nested Repeat Region</title> </head> <body> <% While ((Repeat1__numRows <> 0) AND (NOT rsNewsletter.EOF)) %> <% Dim rsNewletterTopic__varNLID rsNewletterTopic__varNLID = "0" If (rsNewsletter("NLID") <> "") Then rsNewletterTopic__varNLID = rsNewsletter("NLID") End If %> <% Dim rsNewletterTopic Dim rsNewletterTopic_numRows Set rsNewletterTopic = Server.CreateObject("ADODB.Recordset") rsNewletterTopic.ActiveConnection = MM_connDN_STRING rsNewletterTopic.Source = "SELECT * FROM tblNewsletterTopic WHERE NLID = " + Replace(rsNewletterTopic__varNLID, "'", "''") + "" rsNewletterTopic.CursorType = 0 rsNewletterTopic.CursorLocation = 2 rsNewletterTopic.LockType = 1 rsNewletterTopic.Open() rsNewletterTopic_numRows = 0 %> <% Dim Repeat2__numRows Dim Repeat2__index Repeat2__numRows = -1 Repeat2__index = 0 rsNewletterTopic_numRows = rsNewletterTopic_numRows + Repeat2__numRows %> <%=(rsNewsletter.Fields.Item("NLTitle").Value)%><br /> <% While ((Repeat2__numRows <> 0) AND (NOT rsNewletterTopic.EOF)) %> <%=(rsNewletterTopic.Fields.Item("NLTName").Value)%><br /> <% Repeat2__index=Repeat2__index+1 Repeat2__numRows=Repeat2__numRows-1 rsNewletterTopic.MoveNext() Wend %> <br /> <% rsNewletterTopic.Close() Set rsNewletterTopic = Nothing %> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 rsNewsletter.MoveNext() Wend %> </body> </html> <% rsNewsletter.Close() Set rsNewsletter = Nothing %>
Hope it all makes sense…
Merry Xmas everyone, my New Years resolution will be to try and post more often. I will try and get some ASP stuff together but am struggling for ideas at present, so if you guys think of anything let me know and I’ll see what I can do.
Idea’s on the back of a postcard to https://donenet.wordpress.com… LOL
Ok I know I haven’t been posting a lot lately but I have plenty of excuses, one of them is the re-launch of the DoneNet website – www.donenet.co.uk. The main reson for the change was to conform to DDA (Disability Discrimination Act) standards, using XHTML and CSS and to get rid of all those horrible tables. The technology used was as follows:-
- MS Access
- AJAX (See Examples Section)
I am looking to push for new projects in New Year; I have 2 on the go at present, one for a law firm which will be launching in January and the other being a community based website for my local community council.
If you have any comments on the new look Donenet site please let me know?
He he Moody you finally got me to make a post…..
Heres the rules——
- Grab the closest book to you
- Open Page 123
- Scroll down to the 5th sentence
- Post the next 3 sentences on your blog
- Name the book and author
- Tag 3 people
As with the cookies collection, redirection, and buffering, we must add headers befor the server parses the <HTML> tag in our Active Server Pages.
To allow proxy servers to cache output, generated by our ASP pages, we can use the cachecontrol property.
This property can have two values-public or private. If the value of this property is public, the output will be caqched by proxy servers.
Name of book:- Professional Active Server Pages 2.0 by Wrox
- Twilight Town
Get blogging people…..
Hey Moo, the persistant nagging paid of…. LOL
It’s been a while since my last post but I was gutted when England were dumped out of the world cup, but look out i’m back and i’m gonna be doing some more ASP (any suggestions?)
Well it finally happened on Saturday, the bloody lucky cheating Portuguese gets knocked us out on penalties. I havn’t been able to sit at a computer since due to the agony of the coverage on the web….
Well I’m back now and looking forward to Euro 2008, we have a good chance as the group is a fantastic draw for us.
I will be developing some new ASP tips and tricks very soon and will probably theme them around footie, if you have any requests then drop me a comment or e-mail…
OK here's a short one, this example shows you how do the basics with variables, it demonstrates how to do a simple bit of maths on a shopping cart.
vCART = 47.99 'this variable would hold the total cart price including VAT, you would probably hold this information in a session variable but for this example I have hard coded the price in
vSHIPPING = 3.99
vTOTAL = vCART+vSHIPPING 'this variable will give the total price including shipping
To write the total out on the web page all you have to do is:-
And thats it.