Solved

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

Posted on 2004-10-08
6
2,927 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.NET MVC 2 31
Database Connections Not being returned to Connection Pool 7 25
.NET 2008 VB and C# 6 27
vb.net winforms sizing/resolution? 4 32
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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