Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-10-08
6
Medium Priority
?
3,103 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
[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
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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 7

Expert Comment

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

0
 
LVL 7

Accepted Solution

by:
jackiechen858 earned 2000 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

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 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