Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP dynamic text - txt into html 1

Status
Not open for further replies.

flashbbeb

MIS
Mar 29, 2005
106
US
Hi all,

I'm trying to create a page that dynamically pulls in text for different divs from a text file.

Right now, I'm working in straight HTML/CSS with an announcements page, but I want it to be dynamic for others without coding experience to easily be able to update via a text file. I've considered include options, but want to keep it as simple as a txt.

Example:
Code:
<p class="headline">Announcements</p>
 <ul>
    <!-- The number of these would also be dynamic -->
    <li>DYMAMICALLY PULLED TEXT HERE</li>
    <li>DYMAMICALLY PULLED TEXT HERE</li>
    <li>DYMAMICALLY PULLED TEXT HERE</li>
    <li>DYMAMICALLY PULLED TEXT HERE</li>
    <li>DYMAMICALLY PULLED TEXT HERE</li>
</ul>

I'm a novice when it comes to ASP, and I'm work with a learning management system whose only option for this would be ASP.

Thanks,
EB
 
If it's just HTML/plain text you can use FSO to response out the contents of as many text files as you'd like
Code:
set fso = createobject("scripting.filesystemobject")
if fso.fileexists("Path\whateverfile.ext") then
  set fo = fso.opentextfile("path\whateverfile.ext",1) ' open read only
  response.write fo.readall
  set fo = nothing
end if
set fso = nothing


[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
for more than one you just need to establish the conditions of how to pick the files, then use the if block repeatedly

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top