?
Solved

Edit page content (html...to...asp)

Posted on 2014-03-06
2
Medium Priority
?
627 Views
Last Modified: 2014-03-12
I want to have:

- links.asp (displays info from data.xml)
- edit.asp (to edit data.xml)
- data.xml

links.asp has some div tags, ul tags (each with a few li). This page gets some ul and li tags texts from data.xml to displays.

If this is practical, could you please give me a simple ul with few items in data.xml to be displayed on links.asp. Also edit.asp to edit data.xml content via a few text boxes on it.

If this is not practical, then what is a better approach? Could use vs 2010.

Thank you.
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39908700
I would start with data.asp that was delimited.  In this case, you can use the CR LF. Your data.asp page would
one.asp
two.asp
three.asp

Open in new window

The edit.asp would use file systemobject to read the text file http://www.4guysfromrolla.com/webtech/faq/FileSystemObject/faq2.shtml and http://www.4guysfromrolla.com/webtech/faq/FileSystemObject/faq3.shtm

Please note, this code is for sample only. I have not tested it and you should always scrub your data before writing and I have not done that here.  
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
const strFileName = "D:\webroot\data.asp"
Dim objTextStream

'-------------------- for writing to the file --------------------------------
if request.form("links")<>"" then

Set objTextStream = objFSO.OpenTextFile("C:\SomeFile.txt", fsoForWriting, True)

'Display the contents of the text file
objTextStream.WriteLine request.form("links")

'Close the file and clean up
objTextStream.Close
Set objTextStream = Nothing
end if
'--------------------------------------------------------------


'************* For displaying in text area *****************

const fsoForReading = 1

If objFSO.FileExists("D:\webroot\data.asp") then
	'The file exists, so open it and output its contents
	Set objTextStream = objFSO.OpenTextFile(strFileName, fsoForReading)
	Response.Write "<textarea name=""links"">" & objTextStream.ReadAll & "</textarea>"
	objTextStream.Close
	Set objTextStream = Nothing
Else
	'The file did not exist
	Response.Write strFileName & " was not found."
End If

'******************************
'Clean up
Set objFSO = Nothing

Open in new window


And you can see how you in your links.asp you can use fso to write the data just as I have done in the textarea. I do think it would be easier to use a database though.
0
 
LVL 34

Author Closing Comment

by:Mike Eghtebas
ID: 39924201
Thank you.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question