- Online Barcode Generator
- How To
- Buy Now
Button Size in ASP.NET
Button size is an important factor that is related to the button style. In order to help developers create a button with custom size, the PerButton Control specifically adds related properties for users to modify button size programmatically. The button size is controlled by two elements, which are width and height. In this online tutorial page, we will offer you two methods for changing the button width and height respectively in aspx web page.
How to Customize Button Size Programmatically
UI SDK for ASP.NET AJAXT allows users to change the button size with two possible methods.
Customize Width & Height of Button via Properties
The PerButton Control enables users to set the values of button height and button width directly using Width property and Height property. And here we offer you a sample code on how to set the button width and height using the Width and Height properties respectively.
this.PerButton.Width = 200;
Besides, we here specifically demonstrate two buttons with different sizes with the purpose to help you have a better understanding of the two button size related properties.
Set Button Size via CSS Class
Apart from the method to modify the button size using above mentioned button sizing properties, the PerButton Control also allows users to customize the button width & height via CSS class. And here we will guide you how to use css class to change the button size step by step.
1. Add a css class to the PerButton Control using following sample code.
this.PerButton.CssClass = "cssSize";
2. Modify button size with custom width and height in css class.
The customization of button size via css class has been finished.
Related Button Style Tutorials
Apart from the button size, the PerButton Control also offers another factor for developers to change the button appearance style, which is button skin. And you can find detailed programming examples on how to change button skin style using ASP.NET AJAX by following this link to Button Skin Style.
ASP.NET AJAX UI Controls