Solved

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

Posted on 2004-10-08
6
2,881 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 69

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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

17 Experts available now in Live!

Get 1:1 Help Now