ASP 101 - Active Server Pages 101 - Web04
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash





FAQ for the Web Log sample:


How do I change the formatting of the entries so that users see the headlines, but without the hyperlinks?

The HTML formatting is really completely up to you. The only thing the script really cares about are the line breaks (vbCrLf) because it uses them to distinguish one entry from the next. Aside from that you can format the entries pretty much as you like.

The key to changing the formatting is the line of code immediately following the comment:

    ' Formatting is completely up to you...

In the existing script the line (which is broken across several lines for readability) looks something like this:

    strNewEntry = "<tr><td><a href=""" & strURL & """>" _
        & "<font color=""#0000FF"">" _
        & Server.HTMLEncode(strHeadline) _
        & "</font></a></td></tr>"

The actual table tags are contained in the web page that hosts the web log, but the formatting will vary based on you application. In an attempt to directly address the question which was asked, below you will find the exact same code with only the hyperlink removed:

    strNewEntry = "<tr><td>" _
        & "<font color=""#0000FF"">" _
        & Server.HTMLEncode(strHeadline) _
        & "</font></td></tr>"

I don't want the last entry to get bumped off when I add a new one. Is there a way to change the script so that there is no limit on the number of entries?

Sure... simply comment out the line that removes the oldest entry when adding a new one. You can find the line in question right in the middle of the AddNewEntryToFile subroutine. Look for the comment that starts with "Pull oldest entry off the bottom" and comment out the line of code immediately following that two-line comment by placing a ' character at the beginning of that line.

Commenting out that line of code should result in new entries still being added, but old ones not getting deleted. This means that the weblog.txt file will continue to grow with each entry you add and will not get any smaller until you manually remove old entries.

Was your question not answered above?

Ask a new question

Please note: This form is only for submitting questions about the sample for us to consider including in the FAQ. If we feel the question merits inclusion, we will include it along with a reply. We will not respond to your email individually.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers