|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Carriage Return and Response.Write Output Issuea varchar. If the user adds/edits a detailed description, they do so in a MulltiLine TextBox control. Therefore, they are able to click enter on their keyboard and have multiple carriage returns inside the DetaildDescription. My problem is that I have another webpage in my project that has the following statement in it: Response.Write(drSQL.Item("DetailDescription")). If the user created a record in the following format: HELLO WORLD It is now displayed as: HELLO WORLD Is there something I can add to my Response.Write statement so that the carriage returns are "written" so that the output is in the following format: HELLO WORLD I hope this makes sense. Thanks, CR Junk Response.Write(Replace(vbCrLf, "<br>"))
Show quoteHide quote "crjunk" <crj***@earthlink.net> wrote in message news:1160579676.405500.219170@c28g2000cwb.googlegroups.com... >I have a field in a SQL Server table named DetailedDescription that is > a varchar. If the user adds/edits a detailed description, they do so > in a MulltiLine TextBox control. Therefore, they are able to click > enter on their keyboard and have multiple carriage returns inside the > DetaildDescription. > > My problem is that I have another webpage in my project that has the > following statement in it: > Response.Write(drSQL.Item("DetailDescription")). > > If the user created a record in the following format: > HELLO > WORLD > > It is now displayed as: > HELLO WORLD > > Is there something I can add to my Response.Write statement so that the > carriage returns are "written" so that the output is in the following > format: > HELLO > WORLD > > I hope this makes sense. > > > Thanks, > CR Junk > crjunk wrote:
Show quoteHide quote > I have a field in a SQL Server table named DetailedDescription that is A. Display the data in a textarea instead of response.writing it into> a varchar. If the user adds/edits a detailed description, they do > so in a MulltiLine TextBox control. Therefore, they are able to > click enter on their keyboard and have multiple carriage returns > inside the DetaildDescription. > > My problem is that I have another webpage in my project that has the > following statement in it: > Response.Write(drSQL.Item("DetailDescription")). > > If the user created a record in the following format: > HELLO > WORLD > > It is now displayed as: > HELLO WORLD > > Is there something I can add to my Response.Write statement so that > the carriage returns are "written" so that the output is in the > following format: > HELLO > WORLD > the html B. Surround the data in <PRE></PRE> tags C. Replace the carriage returns with <BR> - this is basic html. -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. Hi, if i were you, i would use the same as Gomer's but with little
modification Response.Write(replace(drSQL.Item("DetailDescription"),chr(13),"<BR>") what i did is that i replaced the vbCrLf to chr(13), because the vbCrLfis combination of chr(13) and chr(10), so what if the user had used a format that he only included the chr(13), then if you use the vbCrLf it will not work, because using the vbCrlf will look for the two at once which only one is available. And by the way, according to me testings, chr(13) is required for the enter more than the chr(10) which means chr(10) is always to occure. And if you still want to use his advice, then use it this way: use vbCr instead of chr(13) Best Regards Firas S Assaad crjunk wrote: Show quoteHide quote > Thanks for the responses. I ended up using Gomer's suggeetion. > > CR Junk
Show quote
Hide quote
"Firas" <firas***@gmail.com> wrote in message There are two end-of-line markers in common use. CRLF or just plain LF.news:1161052940.189145.108950@m7g2000cwm.googlegroups.com... > Hi, if i were you, i would use the same as Gomer's but with little > modification > Response.Write(replace(drSQL.Item("DetailDescription"),chr(13),"<BR>") > > what i did is that i replaced the vbCrLf to chr(13), because the vbCrLf > is combination of chr(13) and chr(10), so what if the user had used a > format that he only included the chr(13), then if you use the vbCrLf it > will not work, because using the vbCrlf will look for the two at once > which only one is available. And by the way, according to me testings, > chr(13) is required for the enter more than the chr(10) which means > chr(10) is always to occure. > And if you still want to use his advice, then use it this way: use vbCr > instead of chr(13) > I've not come across many (in fact never have) systems that only use CR. What tests did you use to discover that CR on it's own is more common or indeed ever happens at all? My solution BTW is :- Show quoteHide quote Replace(Replace(Server.HTMLEncode(s), vbCR, ""), vbLF, "<br />") > > Best Regards > Firas S Assaad > crjunk wrote: > > Thanks for the responses. I ended up using Gomer's suggeetion. > > > > CR Junk > we're talking about someone hitting the enter key in text area on a web
page... how would this ever be translated into anything other than crlf?? Show quoteHide quote "Anthony Jones" <A**@yadayadayada.com> wrote in message news:eN9yaOe8GHA.4476@TK2MSFTNGP04.phx.gbl... > > "Firas" <firas***@gmail.com> wrote in message > news:1161052940.189145.108950@m7g2000cwm.googlegroups.com... >> Hi, if i were you, i would use the same as Gomer's but with little >> modification >> Response.Write(replace(drSQL.Item("DetailDescription"),chr(13),"<BR>") >> >> what i did is that i replaced the vbCrLf to chr(13), because the vbCrLf >> is combination of chr(13) and chr(10), so what if the user had used a >> format that he only included the chr(13), then if you use the vbCrLf it >> will not work, because using the vbCrlf will look for the two at once >> which only one is available. And by the way, according to me testings, >> chr(13) is required for the enter more than the chr(10) which means >> chr(10) is always to occure. >> And if you still want to use his advice, then use it this way: use vbCr >> instead of chr(13) >> > > There are two end-of-line markers in common use. CRLF or just plain LF. > I've not come across many (in fact never have) systems that only use CR. > What tests did you use to discover that CR on it's own is more common or > indeed ever happens at all? > > My solution BTW is :- > > Replace(Replace(Server.HTMLEncode(s), vbCR, ""), vbLF, "<br />") > > > > >> >> Best Regards >> Firas S Assaad >> crjunk wrote: >> > Thanks for the responses. I ended up using Gomer's suggeetion. >> > >> > CR Junk >> > > I think that's exactly Anthony's question. Perhaps Firas is aware of a
browser that will use vbCr instead of vbCrLf. XML noob wrote: Show quoteHide quote > we're talking about someone hitting the enter key in text area on a > web page... > how would this ever be translated into anything other than crlf?? > > > "Anthony Jones" <A**@yadayadayada.com> wrote in message > news:eN9yaOe8GHA.4476@TK2MSFTNGP04.phx.gbl... >> >> "Firas" <firas***@gmail.com> wrote in message >> news:1161052940.189145.108950@m7g2000cwm.googlegroups.com... >>> Hi, if i were you, i would use the same as Gomer's but with little >>> modification >>> Response.Write(replace(drSQL.Item("DetailDescription"),chr(13),"<BR>") >>> >>> what i did is that i replaced the vbCrLf to chr(13), because the >>> vbCrLf is combination of chr(13) and chr(10), so what if the user >>> had used a format that he only included the chr(13), then if you >>> use the vbCrLf it will not work, because using the vbCrlf will look >>> for the two at once which only one is available. And by the way, >>> according to me testings, chr(13) is required for the enter more >>> than the chr(10) which means chr(10) is always to occure. >>> And if you still want to use his advice, then use it this way: use >>> vbCr instead of chr(13) >>> >> >> There are two end-of-line markers in common use. CRLF or just plain >> LF. I've not come across many (in fact never have) systems that only >> use CR. What tests did you use to discover that CR on it's own is >> more common or indeed ever happens at all? >> >> My solution BTW is :- >> >> Replace(Replace(Server.HTMLEncode(s), vbCR, ""), vbLF, "<br />") >> >> >> >> >>> >>> Best Regards >>> Firas S Assaad >>> crjunk wrote: >>>> Thanks for the responses. I ended up using Gomer's suggeetion. >>>> >>>> CR Junk -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. "XML noob" <l***@s.com> wrote in message If you pass stuff around via XML you will find CRLFs being converted to justnews:OxW0$Kg8GHA.3760@TK2MSFTNGP02.phx.gbl... > we're talking about someone hitting the enter key in text area on a web > page... > how would this ever be translated into anything other than crlf?? > LFs. Show quoteHide quote > > "Anthony Jones" <A**@yadayadayada.com> wrote in message > news:eN9yaOe8GHA.4476@TK2MSFTNGP04.phx.gbl... > > > > "Firas" <firas***@gmail.com> wrote in message > > news:1161052940.189145.108950@m7g2000cwm.googlegroups.com... > >> Hi, if i were you, i would use the same as Gomer's but with little > >> modification > >> Response.Write(replace(drSQL.Item("DetailDescription"),chr(13),"<BR>") > >> > >> what i did is that i replaced the vbCrLf to chr(13), because the vbCrLf > >> is combination of chr(13) and chr(10), so what if the user had used a > >> format that he only included the chr(13), then if you use the vbCrLf it > >> will not work, because using the vbCrlf will look for the two at once > >> which only one is available. And by the way, according to me testings, > >> chr(13) is required for the enter more than the chr(10) which means > >> chr(10) is always to occure. > >> And if you still want to use his advice, then use it this way: use vbCr > >> instead of chr(13) > >> > > > > There are two end-of-line markers in common use. CRLF or just plain LF. > > I've not come across many (in fact never have) systems that only use CR. > > What tests did you use to discover that CR on it's own is more common or > > indeed ever happens at all? > > > > My solution BTW is :- > > > > Replace(Replace(Server.HTMLEncode(s), vbCR, ""), vbLF, "<br />") > > > > > > > > > >> > >> Best Regards > >> Firas S Assaad > >> crjunk wrote: > >> > Thanks for the responses. I ended up using Gomer's suggeetion. > >> > > >> > CR Junk > >> > > > > > >
Convert the code from gb2312 to unicode in ASP
retreiving data from html page Quizz script performance bug -- too many questions? interesting problem... Percentage Calculation question.... Assign Javascript value to asp session variable XML - load contents onto page. how to run a bat file in remote PC through ASP Running Bat file from ASP on Windows Server x64 problem. Richard Mueller... you out there? |
|||||||||||||||||||||||