Starving newbie.....needs code feed

  • Thread starter Thread starter Sarah
  • Start date Start date
S

Sarah

I am trying to print the following code inside a code behind file (in an
Asp.net file)

Response.Write("This is Line1" & _

vbCRLF & "Now on Line 2 " & _

vbCRLF & "And finally this is Line 3")


When it prints inside a web browser, it keeps printing on the same line
something like

This is Line1Now on Line2And finally this is Line3

instead of

This is Line1
Now on Line2
And finally this is Line3

I know &_ mean continue code in next line. But I thought vbCRLF is for
printing(executing)
in next line. Am I so damn completely screwed up ridiculously beyond
freaking belief ?


Also what is the URL for MSDN's language reference (lists each command
with examples) for VB.net ?
I could not find it in vb.net pages of MSDN (I see all the code samples etc
but not a URL to lang reference)

Thanks
 
Sarah,
for internet pages you will have to use "<br>" instead of
vbCRLF.
Response.Write("This is Line1" & _
"<br>" & "Now on Line 2 " & _
 
Awshucks I knew that & tried it.
But I screwed up in that I did not "<br>" I just did <br>\
Forgot the " "
I kept thinking may be it is just VB, since it is inside a code behind file

Stupid compiler ......(hey I need someone to blame & redeem myself !)
Why can't it come back & simply say "Did you mean "<br>" "
Instead of some (bill)gatey (ha ! new term for geeky) error message
Compiler Error Message: BC30201: Expression expected
 
Hi Sarah,

Compiler Error Message: BC30201:
Expression expected.

"F*CK!!
Do you want another expression, compiler?"

:-)

Regards,
Fergus
 
Sarah,
I was in doubt if you was using the compiler, but happenly Fergus showed
that you do.

The code you use is old vb.script asp style.
It is easier to use the controls like on a windowform.

Unhappenly Microsoft did not do there job so well with this.
In mine opinion you should of course have been able to write.
me.label1.text = This is Line1" & _
vbCRLF & "Now on Line 2 " & _
vbCRLF & "And finally this is Line 3"
But that does not work.
It only works when you use old JavaScript style
me.label1.text = "This is Line1 <br> vbCRLF <br> Now on Line 2 <br> And
finally this is Line 3"

The code that you did make now, gives as far as I know an unconrolled line
on a webpage and you cannot do anything more with that page.

I hope I helped you something further.

Cor
 
Hello,

Mark said:
for internet pages you will have to use "<br>" instead of
vbCRLF.
Response.Write("This is Line1" & _
"<br>" & "Now on Line 2 " & _
"<br>" & "And Finally this is line 3.")

Or "<br/>" ir you are using XHTML.
 
Back
Top