DotNet Mirror
  DNM facebook   DNM Google+   DNM Twitter   

Display multiline text on ASP.NET Button

By Ashok Nalam on 26 Nov 2013 | Category: ASP.NET | Tagged: button .NET 
  Discuss Add Comment   |  
Add rating Rate this resource   
The tip shows how to display ASP.NET button with Multiline text. This could be a rare scenario but still you can achieve it using following code. 

Designer:
<asp:Button ID="btnTextasMulLines" runat="server" Text="Button Text&#010;in&#010;Multiple lines" Width="150px" Height="100px" />
<br />
<asp:Button ID="btnTextasMulLinesCB" runat="server" Width="150px" Height="100px" />
Code:
protected void Page_Load(object sender, EventArgs e)
    {
        btnTextasMulLinesCB.Text = "Button Text" + Environment.NewLine + "in" + Environment.NewLine + 	    "Multiple lines" + Environment.NewLine + "from Codebehind";
    }

Output:

Note: Its works in most of the browsers but for compatibility issue Please test the functionality with all browsers.
  Discuss Add Comment    
Add rating Rate this resource   
About the Contributor
Member Since : 10 Dec 2012
Member Points (Level) : 9526  (Professional)
Location : INDIA
Home Page : http://dotnetmirror.com
About : I am admin of this site.
Rate this resource
 
Add your Comment
Name Email WebSite
Captcha Refresh


Comments (0)
No comments found, click here to add comment.
 
cheap jordans|wholesale air max|wholesale jordans|wholesale jewelry|wholesale jerseys