Solved

How can I make ASP.net Web Form buttons wrap?

Posted on 2004-10-08
6
2,970 Views
Last Modified: 2012-08-14
Apparenly ASP.net Web Form buttons do not wrap their text. How can I force them to wrap in the properties?
Found I could use code Button.text = "Line1" & vbCRLF & "Line2", but there must be an easier way.
0
Comment
Question by:wsfindlater
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 12260429
Button.text = "Line1<BR>Line2"
0
 

Author Comment

by:wsfindlater
ID: 12260653
No, that does not seem to work in a button.
0
 
LVL 6

Expert Comment

by:ryerras
ID: 12265998
Hi,

The following I stole it from Google. The message was posted by a guy from Microsoft online support. I guess it should help you. Take a look

*****************************
Thanks for posting in the community!
From your description, you'd like to make the text of the html button on
the web page auto wrap when there are multi words in it and the width is
not enought, yes?

After some researching , I found that it seems a existing limitation of the
html buttons that the normal word-wrap css style not works on them.
There're  three kinds of button in html page:
<input type=submit ..>
<input type=button ..>
<button >

the ASP.NET server button is usually mapped to the <input type=submit>
So if we use the above two kinds of button, we may meet the limitation of
wrapping the button's text.
However, I've found some one use the below styles of button which can
contains a text block(which has been set the word-wrap style).
------------------------------
<BUTTON id="btnWrap" type="button" runat="server">
       <div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM:
0px; MARGIN: 0px; WIDTH: 70px; PADDING-TOP: 0px; HEIGHT: 48px; WORD-WRAP:
break-word"
        width="100%">this is a casfdsfdsfsdfsdfsfsdfdsfsft</div>
</BUTTON>
------------------------------

So do you think it possbile that we use the above means to workaround this
problem? Please have a check and feel free to let me know if you have any
other ideas. Thanks.



Regards,

Steven Cheng
Microsoft Online Support
***********************************************

0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 7

Expert Comment

by:jackiechen858
ID: 12266054
could you try &#10; ?

0
 
LVL 7

Accepted Solution

by:
jackiechen858 earned 500 total points
ID: 12266075
just tested it on a aspx page, works fine. just put
<BUTTON ... text="first line&#10;second line" >
0
 

Author Comment

by:wsfindlater
ID: 12277550
Thanks,
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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