ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Displaying the newsletter archives --> Part 4

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
121 active users
2796 visitors today
4935 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Displaying the available dates

We now have a filled in sDates array, that contains the dates of all the available newsletters. To display a list of them in the left column, and make them hyperlinks to the relevant newsletter I do this:

for ( var nIssue=0; nIssue<nTotal; nIssue++ )
{
      // add separators for date parsing
      var sDate = sDates [ nIssue ];

      sDate = sDate.substr ( 2, 2 ) + '/' + sDate.substr ( 4, 2 ) + '/20' + sDate.substr ( 0, 2 );

      Out ( '<a href="Archives.asp?issue=' + nIssue + '">' + FormatDateDMYv ( sDate ) + '</a><p>' );
}

The values in the sDates array are similar to "010324", which relates to 24th March, 2001. The first few lines above split up the original string into a form that can be formatted by the FormatDateDMYv( ) function found in my utils/Format.asp SSI.

The date is made into a hyperlink to "Archives.asp?issue=X", where X is the issue number. Note that Archives.asp is the current page, just with an optional parameter giving the newsletter to display.

As we'll see next, if that parameter isn't supplied the latest newsletter is displayed - probably the one you'd want to see, right?

Part 5: Displaying the newsletter...

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems



I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...


See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!