469,323 Members | 1,248 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

loosing page breaks

When I collect the text from a form's text box, I am loosing the page
breaks.

When using C# in the past, I used this:
Expand|Select|Wrap|Line Numbers
  1. string strLine, strParagraph;
  2. StringReader sReader = new StringReader(Request.Form["textMessage"]);
  3. while (sReader.Peek() -1)
  4. {
  5. strLine = sReader.ReadLine();
  6. strParagraph += strLine;
  7. if (strLine == "")
  8. {
  9. strParagraph += "<br/><br/>";
  10. }
  11. }
  12.  
How would this be changed for VBScript using Classic ASP? StringReader is a
..NET creature, isn't it?
Sep 19 '07 #1
3 1921
http://www.codingforums.com/archive/...p?t-51849.html

"jp2code" <poojo.com/mailwrote in message news:%2******************@TK2MSFTNGP03.phx.gbl...
When I collect the text from a form's text box, I am loosing the page breaks.

When using C# in the past, I used this:
Expand|Select|Wrap|Line Numbers
  1. string strLine, strParagraph;
  2. StringReader sReader = new StringReader(Request.Form["textMessage"]);
  3. while (sReader.Peek() -1)
  4. {
  5.  strLine = sReader.ReadLine();
  6.  strParagraph += strLine;
  7.  if (strLine == "")
  8.  {
  9.    strParagraph += "<br/><br/>";
  10.  }
  11. }
  12.  

How would this be changed for VBScript using Classic ASP? StringReader is a .NET creature, isn't it?

Sep 19 '07 #2
Amazing!

Replace(Request.Form("textMessage"), vbCrLf, "<br />")

That's a *lot* nicer!
Thanks.

"Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot comwrote in message
news:13*************@corp.supernews.com...
http://www.codingforums.com/archive/...p?t-51849.html

"jp2code" <poojo.com/mailwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
>When I collect the text from a form's text box, I am loosing the page
breaks.

When using C# in the past, I used this:
Expand|Select|Wrap|Line Numbers
  1. string strLine, strParagraph;
  2. StringReader sReader = new StringReader(Request.Form["textMessage"]);
  3. while (sReader.Peek() -1)
  4. {
  5.  strLine = sReader.ReadLine();
  6.  strParagraph += strLine;
  7.  if (strLine == "")
  8.  {
  9.    strParagraph += "<br/><br/>";
  10.  }
  11. }

How would this be changed for VBScript using Classic ASP? StringReader is
a .NET creature, isn't it?


Sep 19 '07 #3
Off topic, but so is this in place of your C#:

string input = Request.Form["textMessage"];
input = input.Replace(Environment.NewLine, "<br />");

--
Mike Brind

"jp2code" <poojo.com/mailwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
Amazing!

Replace(Request.Form("textMessage"), vbCrLf, "<br />")

That's a *lot* nicer!
Thanks.

"Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot comwrote in message
news:13*************@corp.supernews.com...
>http://www.codingforums.com/archive/...p?t-51849.html

"jp2code" <poojo.com/mailwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl. ..
>>When I collect the text from a form's text box, I am loosing the page
breaks.

When using C# in the past, I used this:
Expand|Select|Wrap|Line Numbers
  1. string strLine, strParagraph;
  2. StringReader sReader = new StringReader(Request.Form["textMessage"]);
  3. while (sReader.Peek() -1)
  4. {
  5.  strLine = sReader.ReadLine();
  6.  strParagraph += strLine;
  7.  if (strLine == "")
  8.  {
  9.    strParagraph += "<br/><br/>";
  10.  }
  11. }

How would this be changed for VBScript using Classic ASP? StringReader
is a .NET creature, isn't it?



Sep 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Sims | last post: by
1 post views Thread by Scott | last post: by
2 posts views Thread by darrel | last post: by
1 post views Thread by kaosyeti | last post: by
reply views Thread by bblue | last post: by
reply views Thread by c_shah | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.