Hi,
I writing code that will create asp pages using the file system object. I'm
trying something like this without much luck
<%
..
..
'other code here
Response.Write "<%sName=" & Var & "%>"
%>
How can I do this?
Thanks, Dom 16 1729
now do you want VAR written out? or is that an actual variable on your
pages?
<%
Response.Write "<%sName=" & Var & "%>"
%> ^^ is that a variable you
are trying to write out? or do you want all that in quotes written out,
start with the first < and ending with the last >
"Dom" <nospam> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl... Hi,
I writing code that will create asp pages using the file system object. I'm trying something like this without much luck
<% . . 'other code here
Response.Write "<%sName=" & Var & "%>"
%>
How can I do this?
Thanks, Dom
This is the code I'm actually using:
<%
Dim oFileSystemObject, oFile, sFile, sPageContent
Set oFileSystemObject = CreateObject("Scripting.FileSystemObject")
sFile = Server.MapPath("/services/test_inc.asp")
Set oFile = oFileSystemObject.OpenTextFile(sFile, 1, false, 0)
sPageContent = "<%iProductID=" & iID & "%>"
sPageContent = sPageContent & oFile.ReadAll
Set oFile = oFileSystemObject.CreateTextFile("C:\Inetpub\wwwro o\test.asp",
true)
oFile.WriteLine(sPageContent)
oFile.Close()
Set oFile = Nothing
Set oFileSystemObject = Nothing
%>
"Dom" <nospam> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl... Hi,
I writing code that will create asp pages using the file system object. I'm trying something like this without much luck
<% . . 'other code here
Response.Write "<%sName=" & Var & "%>"
%>
How can I do this?
Thanks, Dom
> now do you want VAR written out? or is that an actual variable on your pages? <% Response.Write "<%sName=" & Var & "%>" %> ^^ is that a variable you are trying to write out? or do you want all that in quotes written out, start with the first < and ending with the last >
Var is a variable. I've posted the actual code.
"Dom" <nospam> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl... Hi,
I writing code that will create asp pages using the file system object.
I'm trying something like this without much luck
<% . . 'other code here
Response.Write "<%sName=" & Var & "%>"
%>
How can I do this?
Thanks, Dom
try this
response.write "<%sName=" & Var & "%>"
This is the code I'm actually using:
<%
Dim oFileSystemObject, oFile, sFile, sPageContent
Set oFileSystemObject = CreateObject("Scripting.FileSystemObject")
sFile = Server.MapPath("/services/test_inc.asp")
Set oFile = oFileSystemObject.OpenTextFile(sFile, 1, false, 0)
sPageContent = "<%iProductID=" & iID & "%>"
sPageContent = sPageContent & oFile.ReadAll
Set oFile = oFileSystemObject.CreateTextFile("C:\Inetpub\wwwro o\test.asp",
true)
oFile.WriteLine(sPageContent)
oFile.Close()
Set oFile = Nothing
Set oFileSystemObject = Nothing
%>
<%
var = "James Jones"
Response.Write "<%" & "sName = " & Var & "%>"
%>
that will display
<%sName=James Jones%>
<%
Response.Write "<%" & "sName = & Var & %>"
%>
that will display:
<%sName = & Var & %>
hope this was helpful
"Dom" <nospam> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl... This is the code I'm actually using:
<% Dim oFileSystemObject, oFile, sFile, sPageContent
Set oFileSystemObject = CreateObject("Scripting.FileSystemObject")
sFile = Server.MapPath("/services/test_inc.asp")
Set oFile = oFileSystemObject.OpenTextFile(sFile, 1, false, 0)
sPageContent = "<%iProductID=" & iID & "%>" sPageContent = sPageContent & oFile.ReadAll
Set oFile = oFileSystemObject.CreateTextFile("C:\Inetpub\wwwro o\test.asp", true)
oFile.WriteLine(sPageContent)
oFile.Close() Set oFile = Nothing Set oFileSystemObject = Nothing %>
<% var = "James Jones" Response.Write "<%" & "sName = " & Var & "%>" %>
that will display
<%sName=James Jones%>
<% Response.Write "<%" & "sName = & Var & %>" %>
that will display:
<%sName = & Var & %>
hope this was helpful
It displays it on the page, however, IIS isn't processing it a VB script,
just outputting it as HTML.
what are you wanting it to display exactly?
type in what you are wanting to show, if you could
"Dom" <nospam> wrote in message
news:ec**************@TK2MSFTNGP02.phx.gbl... <% var = "James Jones" Response.Write "<%" & "sName = " & Var & "%>" %>
that will display
<%sName=James Jones%>
<% Response.Write "<%" & "sName = & Var & %>" %>
that will display:
<%sName = & Var & %>
hope this was helpful
It displays it on the page, however, IIS isn't processing it a VB script, just outputting it as HTML.
"James Jones" <ja**************@insightbb.com> wrote in message
news:OP**************@TK2MSFTNGP02.phx.gbl... what are you wanting it to display exactly?
type in what you are wanting to show, if you could
I want the script to assign data to the variable correctly.
I posted the actual code earlier if you look through previous posts. I'm
trying to create an asp page using the file system object with embedded vb
scripts. Driving me bonkers now!
Dom wrote: "James Jones" <ja**************@insightbb.com> wrote in message news:OP**************@TK2MSFTNGP02.phx.gbl... what are you wanting it to display exactly?
type in what you are wanting to show, if you could I want the script to assign data to the variable correctly.
I posted the actual code earlier if you look through previous posts. I'm trying to create an asp page using the file system object with embedded vb scripts. Driving me bonkers now!
Posting code is not the same as posting the results you wish to see from the
code. Look at it this way: you say the code is not working correctly. So how
are we supposed to tell by looking at your code what your desired result
should be?
You're starting to drive us bonkers now.
Let me reword it. if the code was to work correctly, and you ran the page,
and viewed source of the resulting page, what would you see as a result of
the code?
One little quirk you should be aware of:
You need to separate the < from the % when response.writing those
characters:
Response.Write "<" & "%" ...
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
> sPageContent = "<%iProductID=" & iID & "%>"
If you do not want the "value" of iID written to the asp file
but indeed want the variable to be processed in the new
asp page you are creating then do as below.
response.write "<% ProductID = iID %>"
this will generate
<% ProductID = iID %>
If you want productID to be pre-assigned in the new page
then
response.write "<% ProductID = " & """" & iID & """" & "%>"
this will generate the following
<% ProductID = "value of iID" %>
"Dom" <nospam> wrote in message
news:en**************@TK2MSFTNGP05.phx.gbl... This is the code I'm actually using:
<% Dim oFileSystemObject, oFile, sFile, sPageContent
Set oFileSystemObject = CreateObject("Scripting.FileSystemObject")
sFile = Server.MapPath("/services/test_inc.asp")
Set oFile = oFileSystemObject.OpenTextFile(sFile, 1, false, 0)
sPageContent = "<%iProductID=" & iID & "%>" sPageContent = sPageContent & oFile.ReadAll
Set oFile = oFileSystemObject.CreateTextFile("C:\Inetpub\wwwro o\test.asp", true)
oFile.WriteLine(sPageContent)
oFile.Close() Set oFile = Nothing Set oFileSystemObject = Nothing %>
"Dom" <nospam> wrote in message news:%2****************@TK2MSFTNGP03.phx.gbl... Hi,
I writing code that will create asp pages using the file system object. I'm trying something like this without much luck
<% . . 'other code here
Response.Write "<%sName=" & Var & "%>"
%>
How can I do this?
Thanks, Dom
> Posting code is not the same as posting the results you wish to see from the code. Look at it this way: you say the code is not working correctly. So how are we supposed to tell by looking at your code what your desired result should be?
The code in my first post said it all. It's not exactly a difficult problem,
just a quirk as you pointed out, and as I orginally thought. Did you read
the first post or just decide to chip in towards the end?
Let me reword it. if the code was to work correctly, and you ran the page, and viewed source of the resulting page, what would you see as a result of the code?
Why complicate the problem - it's a *simple* question. One little quirk you should be aware of:
You need to separate the < from the % when response.writing those characters:
Response.Write "<" & "%" ...
The answer! Didn't hurt, did it?
>> Response.Write "<" & "%" ...
The answer! Didn't hurt, did it?
Yes, it did, because we had to pull teeth asking multiple times what RESULT
you wanted. Why is that part so hard?
Response.Write just displays whatever you tell it to display (wether or not
it looks like ASP code, it's just "data"). You could use Execute or Eval to
actually run this generated code.
You may want also to tell us what is the problem you are trying to solve.
Creating a program that creates code that should then run is likely rarely
needed and it could be perhaps possible to achieve what you are trying to do
in a simpler way...
--
Patrice
"Dom" <nospam> a écrit dans le message de news: ec**************@TK2MSFTNGP02.phx.gbl... <% var = "James Jones" Response.Write "<%" & "sName = " & Var & "%>" %>
that will display
<%sName=James Jones%>
<% Response.Write "<%" & "sName = & Var & %>" %>
that will display:
<%sName = & Var & %>
hope this was helpful
It displays it on the page, however, IIS isn't processing it a VB script, just outputting it as HTML.
Dom wrote: Posting code is not the same as posting the results you wish to see from the code. Look at it this way: you say the code is not working correctly. So how are we supposed to tell by looking at your code what your desired result should be?
The code in my first post said it all. It's not exactly a difficult problem, just a quirk as you pointed out, and as I orginally thought. Did you read the first post or just decide to chip in towards the end?
I'll chip in towards the end...
Next time you want some help from volunteers in news groups (no one
here is obliged to provide you any assistance), I suggest you read this
thoroughly before bashing out your ill-framed questions: http://www.catb.org/~esr/faqs/smart-...ons.html#forum
--
Mike Brind
Mike Brind wrote: Dom wrote: Posting code is not the same as posting the results you wish to see from the code. Look at it this way: you say the code is not working correctly. So how are we supposed to tell by looking at your code what your desired result should be?
The code in my first post said it all. It's not exactly a difficult problem, just a quirk as you pointed out, and as I orginally thought. Did you read the first post or just decide to chip in towards the end?
I'll chip in towards the end...
Next time you want some help from volunteers in news groups (no one here is obliged to provide you any assistance), I suggest you read this thoroughly before bashing out your ill-framed questions:
http://www.catb.org/~esr/faqs/smart-...ons.html#forum
Remove the anchor from that link: http://www.catb.org/~esr/faqs/smart-questions.html
--
Mike Brind This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jon Maz |
last post by:
Hi,
I have written a page to test a function of mine that strips non-English
accents and various other characters out of a given string. The function
itself (called 'StripAll' in the code below)...
|
by: Mike Daniel |
last post by:
I am attempting to use document.write(pageVar) that displays a new html page
within a pop-up window and the popup is failing. Also note that pageVar is
a complete HTML page containing other java...
|
by: Nick Wright |
last post by:
Hi,
I have some business logic in a system that I can't
change. The business logic returns a recordset containing
HTML.
I have an ASP.NET web page with two user controls one is a
header, the...
|
by: Arash Dejkam |
last post by:
Hi All,
Is it possible to write on an <OBJECT type="text/html"> using
document.write() from within the html containing that tag the way we write
on a popup window? I couldn't do that after a lot...
|
by: Malcolm Messiter |
last post by:
Hello
I have a question to while I hope someone has the answer!
In order to send several SMS texts from a web site, I need to invoke a new
URL with a query string containing the parametres. So...
|
by: mallyonline |
last post by:
I last posted to this group about 6 months ago and was very pleased by the
excellent response I got and the great help offered to me. I am back this
time with another request for your expert help...
|
by: news |
last post by:
I'm trying to encapsulate a bunch of html widgets such that a
containing page can call them to draw themselves in whatever order it
chooses as well as easily add new ones.
In order to do this...
|
by: samuelberthelot |
last post by:
Hi,
I have the following in my asp page:
<% response.write(Header) %>
where Header contains HTML markup such ass <html> <body> ....
I must write the code in the aspx file and not in the...
|
by: Manish Sawjiani |
last post by:
Dear experts
i have just migrated from asp to asp.net and i am missing the loop for
creating tables. while in asp one could just start a loop anywhere withing <%
%is this out of style in the...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |