loosing page breaks

J

jp2code

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:
Code:
string strLine, strParagraph;
StringReader sReader = new StringReader(Request.Form["textMessage"]);
while (sReader.Peek() > -1)
{
strLine = sReader.ReadLine();
strParagraph += strLine;
if (strLine == "")
{
strParagraph += "<br/><br/>";
}
}

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

jp2code

Amazing!

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

That's a *lot* nicer!
Thanks.

Jon Paal said:
http://www.codingforums.com/archive/index.php?t-51849.html

jp2code said:
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:
Code:
string strLine, strParagraph;
StringReader sReader = new StringReader(Request.Form["textMessage"]);
while (sReader.Peek() > -1)
{
strLine = sReader.ReadLine();
strParagraph += strLine;
if (strLine == "")
{
strParagraph += "<br/><br/>";
}
}

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

Mike Brind

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 said:
Amazing!

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

That's a *lot* nicer!
Thanks.

Jon Paal said:
http://www.codingforums.com/archive/index.php?t-51849.html

jp2code said:
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:
Code:
string strLine, strParagraph;
StringReader sReader = new StringReader(Request.Form["textMessage"]);
while (sReader.Peek() > -1)
{
strLine = sReader.ReadLine();
strParagraph += strLine;
if (strLine == "")
{
strParagraph += "<br/><br/>";
}
}

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top