Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-03-06
2
Medium Priority
?
632 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 54

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

636 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