Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Use f.writeline to make an asp site

Posted on 2008-10-01
7
Medium Priority
?
339 Views
Last Modified: 2012-08-14
Hi There.

I need to make an asp file with f.writeline but it dosent seem to work.

f.writeline("<%SiteName= "tilbudsaviser"")
f.writeline("<script language="JavaScript">")
f.writeline("<!-- #INCLUDE file="../includes/top.asp" -->")

Can i use an other method?

0
Comment
Question by:bongii
[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
  • 3
  • 3
7 Comments
 
LVL 7

Expert Comment

by:Norush
ID: 22612481
This is not a good way to format a question?
Please supply us with more information?

What is f  ?
Do you want to create an ASP page from another language?
Do you get an error message ?
0
 

Author Comment

by:bongii
ID: 22612496
Well I think it´s pretty clear.
I want to make a .asp file from classic .asp and gets an error:

Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateTextFile(Server.Mappath("test.asp"))
filespec = Server.Mappath("test.asp")
Set f = fso.OpenTextFile(filespec,2)
f.writeline "<%response.write "test"%>

f.writeline "<%response.write "test"%> makes error.
0
 
LVL 2

Assisted Solution

by:devshb
devshb earned 80 total points
ID: 22612521
In your example above, you've got a double-quote inside the line with the javascript include; that'll produce an error because it's treating the double-quote as an end of the whole text string, so replace the relevant double-quotes with 2 double-quotes, as per the attached example

or, alternatively, you can use chr(34), as per the second chunk of code, where ampersand is the asp character which joins/concatenates text strings together
f.writeline("<%SiteName= ""tilbudsaviser""")
f.writeline("<script language=""JavaScript"">")
f.writeline("<!-- #INCLUDE file=""../includes/top.asp"" -->")
 
or:
 
f.writeline("<%SiteName= "&chr(34)&"tilbudsaviser"&chr(34)&")"
f.writeline("<script language="&chr(34)&"JavaScript"&chr(34)&">")
f.writeline("<!-- #INCLUDE file="&chr(34)&"../includes/top.asp"&chr(34)&" -->")

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:bongii
ID: 22612630
But then i need %>

If i write f.writeline("<%SiteName= ""tilbudsaviser""%>"), it makes an error:
f.writeline("<%SiteName= ""tilbudsaviser""
------------------------------------------^
0
 
LVL 7

Expert Comment

by:Norush
ID: 22612667
If you write %> then your current asp-page sees that as the end of an asp statement.

You need to use escapechars for the % sign. So the first line would look like:

"<" & Chr(37) & "SiteName=""tilbudsaviser""" & Chr(37) & ">"
0
 
LVL 7

Accepted Solution

by:
Norush earned 120 total points
ID: 22612668
Here in a code snippet:
"<" & Chr(37) & "SiteName=""tilbudsaviser""" & Chr(37) & ">"

Open in new window

0
 

Author Comment

by:bongii
ID: 22612847
Perfect thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

718 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