Solved

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

Posted on 2014-03-06
2
612 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 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Tag Manager - Add Trigger Using Div class 22 64
Unexpected End of File 11 60
VB script help 23 36
Ways to Manage 2 Development Projects on Same Section 1 21
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 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