Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

word wrap in label

Posted on 2006-11-01
7
Medium Priority
?
1,074 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

719 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