Solved

word wrap in label

Posted on 2006-11-01
7
1,063 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:mwmiller78
  • 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:mwmiller78
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 Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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:mwmiller78
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:mwmiller78
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now