• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

How to make a text wrap in ASP.net <StaticItemTemplate> Button

I want to make interactive menu with <StaticItemTemplate> Buttons. I use a local resources files for dynamically text loading. Is it possible to break text and place it in two lines on a button?

I tryed "<br/> \n etc. But didn't work

 <StaticItemTemplate>
    <asp:Button ID="button1" runat="server" Text='<%# Eval("Text") %>'  Width="117px" Height="59px"
           BorderStyle="None" ForeColor="Black" BackColor="Transparent"   
                        OnCommand="button1_onCommand"  
           CommandName='<%# Eval("Value") %>' meta:resourcekey="button1Resource1" />
      
   </StaticItemTemplate>

Open in new window


Please help me.
0
Leo01010101
Asked:
Leo01010101
  • 5
  • 4
1 Solution
 
slightwv (䄆 Netminder) Commented:
Try this trick.  I've not used it but it makes sense:  http://forums.asp.net/t/1161890.aspx/1
0
 
Leo01010101Author Commented:
Adding "\n" to local resource text didn't work
0
 
slightwv (䄆 Netminder) Commented:
What about the chr(13) noted below that one where it was stated it worked?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Leo01010101Author Commented:
also "\r" in text didn't help. What should be added to local resource text to allow breaking a line?
0
 
slightwv (䄆 Netminder) Commented:
"\r" isn't chr(13).

>>What should be added to local resource text to allow breaking a line?

I'm not sure.  I'll see if I can get some time to experiment and provide some working code.
0
 
Leo01010101Author Commented:
I find a simple solution to place CR sign into the local resource text. I edit text under external editor allowing to place ENTER key hit. I copy it and paste into resource code.
It works properly now in many language switching.

0
 
slightwv (䄆 Netminder) Commented:
OK but that should be the same as the code in the link above:

Button1.Text = "Button" + chr(13) + "Text"
0
 
Leo01010101Author Commented:
Yes, but this code is not possible to place in  a local resource table as a text ( for many languages ).
0
 
slightwv (䄆 Netminder) Commented:
Cool.

Feel free to accept your post http:#a37033858 as the solution.
0
 
Amandeep Singh BhullarCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now