Solved

word wrap in label

Posted on 2006-11-01
7
1,072 Views
Last Modified: 2008-03-04
I've got a multi line text box on one page.
when a user clicks a button on that page, it opens up another window and uses a session
to transfer the data from that textbox to a label on the new page.
is there a way to make the text fit into the size of the label.
it's just making it one long line and i need it to wrap at the end of the label.
thanks.

0
Comment
Question by:Mike Miller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 11

Expert Comment

by:ethoths
ID: 17851799
Use a div (asp:panel) rather than a label and set the css overflow properties accordingly.

0
 

Author Comment

by:Mike Miller
ID: 17851947
what do i set overflow to? auto?
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17853231
It depends on what behavoiur you want. Auto is a good choice but dont forget you also have the text-overflow attribute whick you can set to elipses... That is cool because you can then use other effects to show the whole of the text when you mouseover or click for example.
 
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Expert Comment

by:ethoths
ID: 17853426
PS            

Here some mark up to get you started...

<div onmouseover="document.getElementById('tooltip1').style.visibility='visible';"onmouseout="document.getElementById('tooltip1').style.visibility='hidden';" style="height:20;width:100;background-color:red;overflow:hidden;text-overflow:ellipsis" nowrap >This is a long piece of test that just goes on and on.</div>
<div style="width:144;background-color:yellow;visibility:hidden" id="tooltip1">This is a long piece of test that just goes on and on.</div>
0
 

Author Comment

by:Mike Miller
ID: 17893415
ok i've got it pretty much working now. there's only one other thing. if i enter in a bunch of characters without a break in them
(i.e. wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)
it just has one line and cuts off wherever the label ends. is there any way to force it to wrap within the label using the method above?
0
 
LVL 11

Accepted Solution

by:
ethoths earned 500 total points
ID: 17896421
You'll need to write some code for that one. Either server side or js can do it. Why would you ever have such a thing anyway.

IE has an elipses style. It truncates the string and appends ... to it so that it fits in the conmtainer - but that's not what you want.
0
 

Author Comment

by:Mike Miller
ID: 17898055
no i do want it to fit the container. i'm saying that a continuous string is not fitting the container. it's staying on one line and it just cuts off at the end of the width of the label. it's not really a huge deal since i doubt there will ever be a situation where a user would enter a word longer than the width of the label, it's just something i noticed and figured it could possibly become problematic somewhere down the road.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question