Print Page | Close Window

carriage return in message box

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14278
Printed Date: 30 March 2026 at 11:30am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: carriage return in message box
Posted By: riya_singtel
Subject: carriage return in message box
Date Posted: 17 March 2005 at 2:30am
ok I am using this piece of code:
<%Dim msg
          msg=fun()
          Response.Write("<" & "script language=VBScript>")
          Response.Write("MsgBox """ & msg & """<" & "/script>")
      %>
My function fun() written in ASP Vb script returns a string with characters like "<BR>" to separate lines.Now when the message is displayed in the msg box, it does not show in multiple lines but simply includes the <BR> characters. I understand that I will have to use smth other than <BR> for carriage return. I tried VBCRLF, Chr(13) etc but it returns an error that object is undefined..guess I am missing out on the right syntax to use it..Confused 
 
I tried things like:
disp="This will be displayed" & VBCRLF & "Let's try it"
and
disp="This will be displayed" & '" & VBCRLF & "' & "Let's try it"
 
None work
Can someone help me with it?



Replies:
Posted By: Mart
Date Posted: 17 March 2005 at 2:54am
Try

'This will be displayed \n Let''s try this'


Posted By: riya_singtel
Date Posted: 17 March 2005 at 3:00am
USing single quotes for the string displays syntax error.
If I use \n with double quotes, It still dipalys the string with \n character as it is with the complete string in one line


Posted By: ub3rl337ch3ch
Date Posted: 20 March 2005 at 11:00pm
as far as javascript alerts are concerned, you need to use \r\n to ensure compatability across all browsers. ie doesn't pick up on \n on its own. This should also apply for asp alerts, because it is essentially the same function with a different name.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net