Response.writeLine
How can I write a line (with carriage return + line feed) to the client ?
response.write("abcd"), continue the last line, and doesn't put cr+lf.
response.writeLn is illegal syntax...
How can I write a line (with carriage return + line feed) to the client ?
response.write("abcd"), continue the last line, and doesn't put cr+lf.
response.writeLn is illegal syntax...
I am reading from an xml file and the trying to write the results out to a text file on the server using an asp script
THere is some kind of special characters in one of the fields so it is
causing an error:
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument
How can I strip out these special chars yet keep the html etc. before the writeline I saw a few ~ and box chars that I stripped out of the source xml, I got further but now am stuck again. I cant seem to find this special character, perhaps invisible?
How can I get a string to be written to a text file in a loop with each new string being written on a new line? I assumed that the code below would do just that but it doesn't work.
Set fileCSV = CreateObject("Scripting.FileSystemObject")
Set textCSV = fileCSV.CreateTextFile(pathTotextCSV, True)
for i = 1 to 10
myString = "hello world"&i
textCSV.WriteLine(fsoString)
next
textCSV.Close
Why does this just create one long line?
I'd like to write lines to a file, but it always adds an extra line (I assume it's because of the crlf). Is there a way I can add lines without the auto crlf, so that I add the last line and not the crlf?
View Replies View RelatedI'm trying to append to a file a string such as the following: 127599.0
127838.5 14.434 87
first error - 500 internal server error
refresh
second error - echoes string...does not append file
refresh
third error - permission denied
<%set
file=server.createobject("scripting.filesystemobject").opentextfile(server.m
appath("mpg.txt"),8)
file.writeline(request.querystring("start")&"
"&request.querystring("finish")&" "&request.querystring("gallons")&"
"&request.querystring("octane"))
file.close%>
I create an ASP file using fso.createtextfile. But how do I avoid double quotes and <% %signs when writing to file?
FileAsp.WriteLine("<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252">")
FileAsp.WriteLine("<!-- #Include file="file.asp" -->")
FileAsp.WriteLine(" <% =Blah %>")
I'm writing a asp file dynamically. The code works 70% or the time. It pulls info from access and creates the file -- for some reason though some characters (and I see nothing different about these) causes the following error on the line objfile.writeline
What can I do?
error is:
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument
<a target="_blank"
href="IndividualGamePerformances.asp?MatchID=<%=RS("MatchID")%>&TeamID=<%=Request("TeamID")%>">
Can anyone please tell me what to enter after Response.Write to write the above to the HTTP Response body.
Is there any point in having response.end after response.redirect?
View Replies View RelatedThe following code checks to see if user is an Admin...if not then the user get redirected to another page.
If(accountType <> "Admin") Then
response.redirect "message.asp?msg=20"
Response.End
End if
.
.
.
Code
.
.
My question is:
Do I need Response.End?
Can a user (not an admin) stop the browser from redirecting and execute the code after the if statement?
after looking at someone elses code here I noticed that he
always does a Response.End after a Response.Redirect. I was under the
impression that code execution would stop on the current page as soon as the
Response.Redirect statement appeared, but the guy reckons that the code will
continue running on the current page before starting the new one. Can
someone give me the definitive answer on this?
I must admit I always forget to use "response.end"
and I also forget to "set objects = nothing"
how important are these things.
I know my application run fine without them probably because I usually have
plenty of processing power and ram.
My understanding is that a small peace of ram will be tied up for a set
period of time, and then it will be returned for use.
What is wrong with this line?
response.write <img src="http://mine.web.site/persPictures/" & rs("LastName") & "_" & rs("FirstName") & ".jpg" width=85 border=1>"
I have placed an include to "security.asp" at the top of each .asp page in the Members Area of my client's web site.
When the following code in "security.asp" is executed, the user is redirected to the "join.asp" page but the url in the browser address bar still shows the last page's url.
My first question was, can I hide a form field and make it visible upon
selecting a particular value on a dropdown select field? Hoping for your
immediate response.
I have a page which runs a script. When it gets to the end of the page I want it to do 2 things:
1) take some variables from the page and create an Outlook email with the subject, body and To fields populated with those variables.
2) send the page to another page.
This is roughly the theory:
Response.Redirect("mailto:me@here.com")
Response.Redirect("mypage.asp")
1) I like to know when a problem is solved. When the original person posts a "thank you that solved my problem" message and I see it I know that what they did worked. The macromedia site allows people who opened the thread to close it as "solved" Then you can search for a topic and request only "solved" threads.
2) When I am stuck on something for a long time and someone finally gives me the info. I've been stressing out over. I would feel guilty if I did not thank the helpful person. My parents' good upbringing must have burned into me the idea that you need to say "please" and "thank you".
Just my two cents. Also the Macromedia forum is not a better forum, unless it is a specific question about one of their products. Even then
In my html page to update a table I am forwarding request to a ASP apge bys using form.action="test.asp", and form.submit(). In asp I am doing database update. Response of this I want to show alert box to user whether operation is succesful.
I donot want ot redirect to some other page and I do not want to disturn existing view. I mean I want get only response such as true or false and based on respose I will display alert in front end. I want some thing like this,
form.action="test.asp";
var result=form.submit()
if( result="successfull")
alert("Succesful")
else
alert("failed")
This is my current URL after the process takes place. I want to add in the URL after intCatID & . This additonal paramater [AL = "intAL"], then the error but I forgot how to do this.
<%
Response.Redirect "FileMaintenance.do?CatName=" & strCatName & "&CatID=" & _
intCatID & "&Error=" & Server.URLEncode(intCount & " files were successfully added to the Package.")
%>
I have a Popup window where a user inputs soem data.
On successfully entering this data I redirect the user to
a page in the same popup indicating that the form has
submitted successfully.
I want to resize the page that I redirect the user to.
Is this possible in ASP?
I have a page called createWordDoc.asp, that starts with the line <% Response.ContentType = "application/msword" %>.
What it does, is receicves information from a form on the previous page, formats everything using html, and saves it as a word document.
Everything is working ok, except when I open the word document, there should be a picture in amongst the text, but it isn't there.
Does anyone know about creating word docs from asp, or has anyone had simliar problems?
I've come across some weird bug with Response.Cookies. Or maybe it will be
called "by design" but for the life of me I can't figure out what purpose it
would serve. If you're setting a cookie (say Response.Cookies ("TEST")) and
you have a query string variable &test=x or &Test=x and you get
Request.QueryString to parse the query string, the cookie that gets dropped
matches the case of the query string, not what your code says. In other
words even though the code says Response.Cookies ("TEST"), it drops
Response.Cookies ("test") instead.
Anyone have any idea what's going on here? There's an example below. Try
it with http://127.0.0.1/cookieTest.asp?test=x and without the query string
variable.
<%@Language=Jscript Enablesessionstate=false%>
<%var exp = new Date();
exp.setTime(exp.getTime() + (2 * 365 * 24 * 60 * 60 * 1000))
var expDate = (exp.getUTCMonth()+1) + "/" + exp.getUTCDate() + "/" +
exp.getUTCFullYear()
var x = Request.QueryString ("dummy");
Response.Cookies("TEST") = "This is a test";
Response.Cookies("TEST").Expires = expDate;
%>
Having just migrated to w2k from NT4, I've stumbled across an oddity with
cookie handling - at least, that's what it appears to be.
I (was) using response.buffer with .addheader to write two cookies into a
the http header for a particular page . Worked fine for three years.
After the upgrade, I'm finding that two copies of the same cookie appear,
one with blanks for values, the other with values filled in; this has the
effect of logging the user into the page if the first copy isn't blank....
So, I changed the code to use response.cookie, which is fine, but the
names/values get encoded, and unfortunately the software vendor uses dashes
in the name part.
Is there any way to force .cookie to not encode the '-'?
or do I need to look at javascript to write the cookie?
I am trying to add some basic security to my asp web pages. I have a logon screen which, when the logon and password are checked for validity, passes the user on to a registration screen using the code
response.Redirect "user_reg.asp?User=" & Request.Form("UserName")
I then inserted the following line before the redirect
response.Cookies("ValidUser") = "ValidUser"
I have the following check at the start of the user_reg.asp page
<%
if request.Cookies("ValidUser") <> "VaildUser" then
response.redirect "user_login.asp"
End if
%>
All that happens now is that when I log in validly user_login.asp is
redisplayed rather than the user_reg.asp.
Perhaps this is not sufficient to set the cookie? I have looked for it but
can't see it amoungst other cookies dated today.
I want to know whether a certain function on the database such as add or delete record is successful or not to be indicated after the transaction.
E.g. if a record was not found, or not deleted, the next page should indicate the event. If deleted it should indicate as well.
Can anyone tell me if Response.Redirect works with IE5?, for me its seems to be working with IE6 and Firefox, but seems ineffective with IE5.
I have also set Response.Buffer = True
How to send more than one value using response redirect? For example i can send one like this:
response.Redirect "pregled.asp?ime=" & strUserName
but how to send two or more values? I tried:
response.Redirect("pregled.asp?ime=" & strUserName & " & prezime = " &
strUserLastName)but it didn't work.
How do I use Response.Redirect to point to an interal private box/site? Code:
View Replies View RelatedI writing code that will create asp pages using the file system object.
<%
..
..
'other code here
Response.Write "<%sName=" & Var & "%>"
%>
How can I do this?
If my recordset is empty I want to write "Not Complete" and if there is
a value, I want to write the value. Can someone tell me what I am
doing wrong?
<%
If IsEmpty(rsa.Fields.Item("reclaima")) Then
Response.Write("Not Complete")
Else
Response.Write(rsa.Fields.Item("reclaima"))
End If
%>
Also tried....
<%
If rsa.Fields.Item("reclaima") = "" Then
Response.Write("Not Complete")
Else
Response.Write(rsa.Fields.Item("reclaima"))
End If
%>
IF Trim(Request.QueryString("v")) = "" THEN
Back = Replace(Request.ServerVariables("Http_REFERER"),"http://localhost/","")
ELSE
Back = Request.QueryString("v")
END IF
Response.Redirect(""&Response.write(Back)&"")
why i cannot Redirect to the page?
instead of the below code Code:
Response.Write ("<img src='images/mainheader.png'><p><p style='color:#666666' font-family: Arial, Helvetica, sans-serif;>Your password has been sucessfully changed</p><p><a href='./members.asp' style='color:#a10000' font-family: Arial, Helvetica, sans-serif;>Back to the site</a></p>")
can i have the rsepone go to another page?
Response.Redirect "./members.asp"
would taht work?
I need to know how long it takes my ASP code to fetch a rows from sql server 2000 database. how can i print the time it takes on the page? I need a code wich count the seconds from the time the page loading start and the time all the rows are printed.
View Replies View Related