loosing page breaks
am 19.09.2007 18:56:00 von 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 += "
";
}
}
[/code]
How would this be changed for VBScript using Classic ASP? StringReader is a
..NET creature, isn't it?
Re: loosing page breaks
am 19.09.2007 19:38:45 von Jon Paal
http://www.codingforums.com/archive/index.php?t-51849.html
"jp2code" wrote in message news:%23Rf3y3t%23HHA.4612@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:
> [code]
> string strLine, strParagraph;
> StringReader sReader = new StringReader(Request.Form["textMessage"]);
> while (sReader.Peek() > -1)
> {
> strLine = sReader.ReadLine();
> strParagraph += strLine;
> if (strLine == "")
> {
> strParagraph += "
";
> }
> }
> [/code]
>
> How would this be changed for VBScript using Classic ASP? StringReader is a .NET creature, isn't it?
>
Re: loosing page breaks
am 19.09.2007 20:51:30 von jp2code
Amazing!
Replace(Request.Form("textMessage"), vbCrLf, "
")
That's a *lot* nicer!
Thanks.
"Jon Paal [MSMD]" wrote in message
news:13f2nkh5o3f8de8@corp.supernews.com...
> http://www.codingforums.com/archive/index.php?t-51849.html
>
> "jp2code" wrote in message
> news:%23Rf3y3t%23HHA.4612@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:
>> [code]
>> string strLine, strParagraph;
>> StringReader sReader = new StringReader(Request.Form["textMessage"]);
>> while (sReader.Peek() > -1)
>> {
>> strLine = sReader.ReadLine();
>> strParagraph += strLine;
>> if (strLine == "")
>> {
>> strParagraph += "
";
>> }
>> }
>> [/code]
>>
>> How would this be changed for VBScript using Classic ASP? StringReader is
>> a .NET creature, isn't it?
>>
>
>
Re: loosing page breaks
am 21.09.2007 08:42:20 von Mike Brind
Off topic, but so is this in place of your C#:
string input = Request.Form["textMessage"];
input = input.Replace(Environment.NewLine, "
");
--
Mike Brind
"jp2code" wrote in message
news:%23hdEW4u%23HHA.1416@TK2MSFTNGP03.phx.gbl...
> Amazing!
>
> Replace(Request.Form("textMessage"), vbCrLf, "
")
>
> That's a *lot* nicer!
> Thanks.
>
> "Jon Paal [MSMD]" wrote in message
> news:13f2nkh5o3f8de8@corp.supernews.com...
>> http://www.codingforums.com/archive/index.php?t-51849.html
>>
>> "jp2code" wrote in message
>> news:%23Rf3y3t%23HHA.4612@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:
>>> [code]
>>> string strLine, strParagraph;
>>> StringReader sReader = new StringReader(Request.Form["textMessage"]);
>>> while (sReader.Peek() > -1)
>>> {
>>> strLine = sReader.ReadLine();
>>> strParagraph += strLine;
>>> if (strLine == "")
>>> {
>>> strParagraph += "
";
>>> }
>>> }
>>> [/code]
>>>
>>> How would this be changed for VBScript using Classic ASP? StringReader
>>> is a .NET creature, isn't it?
>>>
>>
>>
>
>