473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 2013
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Sims | last post by:
Hi, I heard that there was a chance of 'loosing' a session ID between pages, (when the user clicks from one link to another). Is it really possible? Where could I find a definitive answer to...
1
by: Scott | last post by:
Was not sure if this was the place to post this or not, so if not, can someone point me in the right direction. Here is my problem - I have an ASP page the is generating a file with HTML that is...
2
by: darrel | last post by:
We have a bunch of usercontrols we are using on our site. One of them calls functions in a compiled DLL (is that a 'resource' in VS.net terminology?) The pages that contains all of these controls...
1
by: kaosyeti | last post by:
hey... i have a report that groups on salespeople. the report footer is a three part summary of the store's total data with 2 different departments for parts 1 and 2 and a store total for part 3. ...
1
by: Owen Richardson | last post by:
I have an asp.net website where i have a quick search facility built into my master page. the search is a web control, with a drop down country box and a list box full of cities. When i select...
5
by: Jens | last post by:
Posted to: comp.periphs.printers comp.lang.c comp.lang.postscript Hello, I am looking for some publically available methods/algorithms or C source code for detecting
0
by: bblue | last post by:
hi, I need help in implementing page breaks in XML files? any suggestion on how can this be done? do you recommend using processing instructions or add a new elements would make more sense? can the...
0
by: c_shah | last post by:
I have a data bound repeater control; in the item template of the repeater I have two checkbox, dropdown list and a button (ASP.net controls). When that button is clicked it goes to another...
1
by: Falcula | last post by:
Hello, I have a treeview control, when i select a item i navigate to url. But selected node is lost, it reset itself, loosing state. I post my code here. Thanks in advance. <script...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.