Click to See Complete Forum and Search --> : Kids play...
turfbult
Apr 10th, 2001, 07:52 AM
Hello,
A very easy one...
How do you get a line break using response.write
IE I want to write...
response.write "Hello Turfbult, how are u" .... like this
hello
turfbult
how
are
u
Thanks,
T
Ianpbaker
Apr 10th, 2001, 08:06 AM
Hi turfbult
All you need to do to is include the <BR> tag in your string.
Resposne.write "Hello<br>Turfbult,<br>how<br>are<br>u"
Hope this helps
Ian
turfbult
Apr 10th, 2001, 08:11 AM
Thanks Ian,
Isn't there another way though, like "vbnewline" or something. Isn't it "bad practice" to mix asp and html??
Wait... I might not have given a good example...
Lets say I have 5 variables and want to print each one on a new line
like ..
var1
var2
var3
If I just say
response.write var1
response.write var2 etc etc. it prints all variables in one row.
So I'm thinking
response.write var1 & vbnewline
response.write var2 & vbnewline
.....or something like that!!!
Thanks,
T
Ianpbaker
Apr 10th, 2001, 08:16 AM
Originally posted by turfbult
Isn't it "bad practice" to mix asp and html??
It's not bad practise at all, There are many cirumstances that you have to mix them together. Hell, asp is just a bolt on to html anyway :)
As for using vbnewline, it won't work. Can't think of any other way, but there is no need to find it :)
Ian
Ianpbaker
Apr 10th, 2001, 08:19 AM
using your example you can trim it down to
<% = Var1 %>
<br>
<% = Var2 %>
<br>
<% = Var3 %>
<br>
<% = Var4 %>
<br>
:)
turfbult
Apr 10th, 2001, 08:19 AM
Thanks, in that case, I'll use it.
BTW. What is the cult for silver service??
T
Ianpbaker
Apr 10th, 2001, 08:24 AM
no worries.
I'ts just a joke mate. Take a look around the chit-chat forum for the "Cult of the rusty spoons" And "the Cult for silver service" :)
sail3005
Apr 10th, 2001, 11:05 AM
Instead of vbnewline, try: vbCrlf
Ianpbaker
Apr 10th, 2001, 11:14 AM
Hi Sail3005
It wont work using vbCrlf Either. If you use that or vbnewline it will just place the code on a new line in the produced output, but without the <br> tags the browser will interpret it as the sam line. Eg.
In HTML
Hello
World
Will show in the browser as Hello World
Wheras
Hello
<br>
World
Will show in the browser as
Hello
World
Ian
hellswraith
Apr 10th, 2001, 12:06 PM
Just a note, ASP produces HTML. So mixing them together is the same. All ASP does is process the code on the server, then creates HTML to send to the users browser.
sail3005
Apr 10th, 2001, 12:13 PM
Yeah, i agree now. I think the best and possibly only way to accomplish that is with <br>.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.