Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Line Wrapping

Reply
Thread Tools

Line Wrapping

 
 
scott
Guest
Posts: n/a
 
      05-26-2005
Is there a way to prevent IE from forcing a line break? Below in LISTING 2,
you notice the table background image extention of '.jpg' begins a new line,
instead of staying on the same line as it's file name. Same happens with my
javascript onclick event, IE forces a line break and breaks my code. In my
asp code, you notice I'm inserting line breaks, but IE seems to do what it
wants. I should note, the below HTML results is actually 1 table of 40 or so
that asp builds as a string.

I mention that because some tables get rendered without line breaks
following the 'jpg' and javascript code. My prolem is that when IE forces
line breaks as below, the code doesn' work.

Any ideas?

LISTING 1 - CODE

ColorInfo = ColorInfo & "<table border=0
background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>" & chr(13) &
chr(10)
ColorInfo = ColorInfo & "<tr><td>" & chr(13) & chr(10)
ColorInfo = ColorInfo & "<a href=""""
onclick=""javascriptW('pop_print.asp?print=" & RS10("choiceData1") &
"',310,400);return false;"">" & chr(13) & chr(10)
ColorInfo = ColorInfo & "<img src=""images/filler.gif"" width=60
height=40 border=0></a>" & chr(13) & chr(10)
ColorInfo = ColorInfo & "</td></tr></table></tr>" & chr(13) & chr(10)
ColorInfo = ColorInfo & "<tr><td align=center><font
face=""verdana,sans-serif"" size=1>" & Replace(RS10("choiceName"),"
","<br>",1,1) & "</font></td></tr></table></td>" & chr(13) & chr(10)


LISTING 2 - RESULTS

<table border=0 background="images/prints/thumb_Abbey
..jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
<tr><td>
<a href="" onclick="javascriptW('pop_print.asp?print=Abbey
',310,400);return false;">
<img src="images/filler.gif" width=60 height=40 border=0></a>
</td></tr></table>


 
Reply With Quote
 
 
 
 
scott
Guest
Posts: n/a
 
      05-26-2005
I tried it, but as you see below, it had no effect. is there any way to
structure my below html so the NOWRAP will work for my problem? i see how it
works with regular text, but my case is a little different.

<table border=0><tr><td NOWRAP align=center>
<table border=0 background="images/prints/thumb_Abbey
..jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
<tr><td NOWRAP><a href="" onclick="javascriptW('pop_print.asp?print=Abbey
',310,400);return false;">
<img src="images/filler.gif" width=60 height=40 border=0></a>
</td></tr></table></tr>
<tr><td align=center><font face="verdana,sans-serif" size=1>Abbey<br>(AYSP)
</font></td></tr></table>


"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:(E-Mail Removed)...
> put it in a Table Cell with NOWRAP on
>
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "scott" <(E-Mail Removed)> wrote in message
> news:OkjSi$(E-Mail Removed)...
>> Is there a way to prevent IE from forcing a line break? Below in LISTING
>> 2, you notice the table background image extention of '.jpg' begins a new
>> line, instead of staying on the same line as it's file name. Same happens
>> with my javascript onclick event, IE forces a line break and breaks my
>> code. In my asp code, you notice I'm inserting line breaks, but IE seems
>> to do what it wants. I should note, the below HTML results is actually 1
>> table of 40 or so that asp builds as a string.
>>
>> I mention that because some tables get rendered without line breaks
>> following the 'jpg' and javascript code. My prolem is that when IE forces
>> line breaks as below, the code doesn' work.
>>
>> Any ideas?
>>
>> LISTING 1 - CODE
>>
>> ColorInfo = ColorInfo & "<table border=0
>> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
>> style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>" & chr(13)
>> & chr(10)
>> ColorInfo = ColorInfo & "<tr><td>" & chr(13) & chr(10)
>> ColorInfo = ColorInfo & "<a href=""""
>> onclick=""javascriptW('pop_print.asp?print=" & RS10("choiceData1") &
>> "',310,400);return false;"">" & chr(13) & chr(10)
>> ColorInfo = ColorInfo & "<img src=""images/filler.gif"" width=60
>> height=40 border=0></a>" & chr(13) & chr(10)
>> ColorInfo = ColorInfo & "</td></tr></table></tr>" & chr(13) & chr(10)
>> ColorInfo = ColorInfo & "<tr><td align=center><font
>> face=""verdana,sans-serif"" size=1>" & Replace(RS10("choiceName"),"
>> ","<br>",1,1) & "</font></td></tr></table></td>" & chr(13) & chr(10)
>>
>>
>> LISTING 2 - RESULTS
>>
>> <table border=0 background="images/prints/thumb_Abbey
>> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
>> <tr><td>
>> <a href="" onclick="javascriptW('pop_print.asp?print=Abbey
>> ',310,400);return false;">
>> <img src="images/filler.gif" width=60 height=40 border=0></a>
>> </td></tr></table>
>>

>
>



 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      05-26-2005
scott wrote:
> Is there a way to prevent IE from forcing a line break? Below in
> LISTING 2, you notice the table background image extention of '.jpg'
> begins a new line, instead of staying on the same line as it's file
> name...
>
> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
>
> <table border=0 background="images/prints/thumb_Abbey
> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>


Are you certain the source does not contain the line break? Does this work
any better?

..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.


 
Reply With Quote
 
scott
Guest
Posts: n/a
 
      05-26-2005
no go, i tried your code. It must be the way IIS renders it. at first, i
thought it was long field values, but it does it on 5 character values or
long ones.

i know there must be a solution, but i've exhausted all means.


"Dave Anderson" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> scott wrote:
>> Is there a way to prevent IE from forcing a line break? Below in
>> LISTING 2, you notice the table background image extention of '.jpg'
>> begins a new line, instead of staying on the same line as it's file
>> name...
>>
>> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
>>
>> <table border=0 background="images/prints/thumb_Abbey
>> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>

>
> Are you certain the source does not contain the line break? Does this work
> any better?
>
> ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""
>
>
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message.
> Use of this email address implies consent to these terms. Please do not
> contact me directly or ask me to contact you directly for assistance. If
> your question is worth asking, it's worth posting.
>



 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      05-26-2005
IIRC Trim will not remove linefeeds.

Try writing out Server.URLEncode(RS10.Fields("choiceData1").Value) to see if
there is something else in the data.

I use similar code to build image urls all the time with no problems.

--
--Mark Schupp


"scott" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> no go, i tried your code. It must be the way IIS renders it. at first, i
> thought it was long field values, but it does it on 5 character values or
> long ones.
>
> i know there must be a solution, but i've exhausted all means.
>
>
> "Dave Anderson" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> scott wrote:
>>> Is there a way to prevent IE from forcing a line break? Below in
>>> LISTING 2, you notice the table background image extention of '.jpg'
>>> begins a new line, instead of staying on the same line as it's file
>>> name...
>>>
>>> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
>>>
>>> <table border=0 background="images/prints/thumb_Abbey
>>> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>

>>
>> Are you certain the source does not contain the line break? Does this
>> work any better?
>>
>> ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""
>>
>>
>>
>> --
>> Dave Anderson
>>
>> Unsolicited commercial email will be read at a cost of $500 per message.
>> Use of this email address implies consent to these terms. Please do not
>> contact me directly or ask me to contact you directly for assistance. If
>> your question is worth asking, it's worth posting.
>>

>
>



 
Reply With Quote
 
scott
Guest
Posts: n/a
 
      05-27-2005
your server encode idea produced some interesting results. it still doesn't
work, but it maintained the filename. problem is it added %0D%OA as you can
see below. It only had that effect on certain records and there was no
pattern or sequence on which ones didn't work. it effected the same records
as before.

what coud be causing those characters?

<table border=0><tr><td NOWRAP align=center>
<table border=0 background="images/prints/thumb_Abbey%0D%0A.jpg"
style='border:solid 1pt #000000;margin: 0px;' cellpadding=0 cellspacing=0>
<tr><td NOWRAP><NOBR><a href=""
onclick="javascriptW('pop_print.asp?print=Abbey
',310,400);return false;"></NOBR>
<img src="images/filler.gif" width=60 height=40 border=0></a>
</td></tr></table></tr>
<tr><td align=center><font face="verdana,sans-serif" size=1>Abbey<br>(AYSP)
</font></td></tr></table>


"Mark Schupp" <(E-Mail Removed)> wrote in message
news:%23$(E-Mail Removed)...
> IIRC Trim will not remove linefeeds.
>
> Try writing out Server.URLEncode(RS10.Fields("choiceData1").Value) to see
> if there is something else in the data.
>
> I use similar code to build image urls all the time with no problems.
>
> --
> --Mark Schupp
>
>
> "scott" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> no go, i tried your code. It must be the way IIS renders it. at first, i
>> thought it was long field values, but it does it on 5 character values or
>> long ones.
>>
>> i know there must be a solution, but i've exhausted all means.
>>
>>
>> "Dave Anderson" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> scott wrote:
>>>> Is there a way to prevent IE from forcing a line break? Below in
>>>> LISTING 2, you notice the table background image extention of '.jpg'
>>>> begins a new line, instead of staying on the same line as it's file
>>>> name...
>>>>
>>>> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
>>>>
>>>> <table border=0 background="images/prints/thumb_Abbey
>>>> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
>>>
>>> Are you certain the source does not contain the line break? Does this
>>> work any better?
>>>
>>> ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""
>>>
>>>
>>>
>>> --
>>> Dave Anderson
>>>
>>> Unsolicited commercial email will be read at a cost of $500 per message.
>>> Use of this email address implies consent to these terms. Please do not
>>> contact me directly or ask me to contact you directly for assistance. If
>>> your question is worth asking, it's worth posting.
>>>

>>
>>

>
>



 
Reply With Quote
 
Giles
Guest
Posts: n/a
 
      05-27-2005

>>
>> what coud be causing those characters?

>
> They are clearly in the database.
>

try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?


 
Reply With Quote
 
Kyle Peterson
Guest
Posts: n/a
 
      05-27-2005
&nbsp;

instead of just normal spaces

can cause trouble as well



"Giles" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
>>>
>>> what coud be causing those characters?

>>
>> They are clearly in the database.
>>

> try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?
>



 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      05-27-2005
%0D%0A = CRLF
That is causing your line wrap. You will need to strip it out before
building the URL. See Giles' suggestion.
You should also have a look into your input application to see why it is
including the CRLF at the end of file names.

--
--Mark Schupp


"scott" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> your server encode idea produced some interesting results. it still
> doesn't work, but it maintained the filename. problem is it added %0D%OA
> as you can see below. It only had that effect on certain records and
> there was no pattern or sequence on which ones didn't work. it effected
> the same records as before.
>
> what coud be causing those characters?
>
> <table border=0><tr><td NOWRAP align=center>
> <table border=0 background="images/prints/thumb_Abbey%0D%0A.jpg"
> style='border:solid 1pt #000000;margin: 0px;' cellpadding=0 cellspacing=0>
> <tr><td NOWRAP><NOBR><a href=""
> onclick="javascriptW('pop_print.asp?print=Abbey
> ',310,400);return false;"></NOBR>
> <img src="images/filler.gif" width=60 height=40 border=0></a>
> </td></tr></table></tr>
> <tr><td align=center><font face="verdana,sans-serif"
> size=1>Abbey<br>(AYSP)
> </font></td></tr></table>
>
>
> "Mark Schupp" <(E-Mail Removed)> wrote in message
> news:%23$(E-Mail Removed)...
>> IIRC Trim will not remove linefeeds.
>>
>> Try writing out Server.URLEncode(RS10.Fields("choiceData1").Value) to see
>> if there is something else in the data.
>>
>> I use similar code to build image urls all the time with no problems.
>>
>> --
>> --Mark Schupp
>>
>>
>> "scott" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> no go, i tried your code. It must be the way IIS renders it. at first, i
>>> thought it was long field values, but it does it on 5 character values
>>> or long ones.
>>>
>>> i know there must be a solution, but i've exhausted all means.
>>>
>>>
>>> "Dave Anderson" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>> scott wrote:
>>>>> Is there a way to prevent IE from forcing a line break? Below in
>>>>> LISTING 2, you notice the table background image extention of '.jpg'
>>>>> begins a new line, instead of staying on the same line as it's file
>>>>> name...
>>>>>
>>>>> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
>>>>>
>>>>> <table border=0 background="images/prints/thumb_Abbey
>>>>> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
>>>>
>>>> Are you certain the source does not contain the line break? Does this
>>>> work any better?
>>>>
>>>> ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""
>>>>
>>>>
>>>>
>>>> --
>>>> Dave Anderson
>>>>
>>>> Unsolicited commercial email will be read at a cost of $500 per
>>>> message. Use of this email address implies consent to these terms.
>>>> Please do not contact me directly or ask me to contact you directly for
>>>> assistance. If your question is worth asking, it's worth posting.
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      05-27-2005
Mark Schupp wrote:
> IIRC Trim will not remove linefeeds.


Yet another reason I like the flexibility of writing my own:

String.prototype.trim = function(){
return this.replace(/(\s*$)|(^\s*)/g,"")
}


Or the more abstracted:

String.prototype.ltrim = function(){
return this.replace(/^\s*/g,"")
}
String.prototype.rtrim = function(){
return this.replace(/\s*$/g,"")
}
String.prototype.trim = function(){
return this.ltrim().rtrim()
}

I am obviously JScript-biased.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
horizontal menu line wrapping issue Carolyn Marenger HTML 4 03-19-2006 02:00 AM
How do I disable Line Wrapping in TableCell? Amelyan ASP .Net 2 05-21-2005 04:02 PM
Force long line wrapping at some character Gnarlodious HTML 9 01-28-2005 08:08 AM
Line wrapping with WebForm Label =?Utf-8?B?bWc=?= ASP .Net 1 01-19-2004 04:16 PM
Line wrapping in ostream Alex Dribin C++ 2 08-06-2003 05:14 PM



Advertisments