Greg Owen
Over 27 Years of Programming Experience
Programming Examples, Portfolio, and More
Home

Add Style Properties to ASP.Net Controls to Improve Appearance

The default formatting for ASP.Net controls is very dated.  The default formatting is basically the same as the formatting in Visual Basic 1.0 which was released in 1991.  The examples below show how to add different styles to improve the the look of asp.net controls.  The styles can be applied with the style tag or through css.  In order to add style to an ASP.Net control, you must manually add the style tag in the HTML Source.

Display a Button With Rounded Corners




The style properties below add rounded corners to the button control.

style="background-color:blue;color:white;border-radius:7px;height:45px;border-style:none;padding:10px;"

Display a Button With Half-Circle Corners



These style properties add half-circle corners to the button control.  In order to achieve the apperance of the button above, the radius must be set equal to the height of the control.

style="background-color:blue;color:white;border-radius:45px;height:45px;border-style:none;padding:10px;"

Display a Circle Button



The style properties below create a button in the form of a circle using the radius property.  In order to form a circle, the width and height properties must be equal.

style="background-color:blue;color:white;border-radius:50%;height:60px;width:60px;border-style:none;"

Display a Button with no Background



These style properties display a button with no background.

style="background-color:white;color:blue;border-style:none;"

Display a DropDownList with Rounded Corners



The style properties below add rounded corners to the DropDownList control.

style="margin:5px;padding:10px;background-color:blue;color:white;border-radius:7px;height:35px;border-style:none;"

Display a DropDownList with Half-Circle Corners


These style properties add half-circle corners to the DropDownList control.

style="margin:5px;background-color:blue;color:white;border-radius:20px;height:35px;border-style:none;"

Display a Circle DropDownList


The style properties below create a DropDownList in the form of a circle using the radius property.  In order to form a circle, the width and height properties must be equal.

style="margin:5px;background-color:blue;color:white;border-radius:50%;height:50px;width:50px;border-style:none;"

Display a DropDownList with no Background


These style properties display a DropDownList with no background.

style="margin:5px;background-color:white;color:blue;border-style:none;"

Display Custom Radio Buttons

Select an option from the list below.
Option 1
Option 2
Option 3
Option 4
Option 5
Option 6


Above is a div with the style listed below.

style="display:inline-block;margin-top:10px;background-color:blue;color:white;width:250px;border-radius:10px;padding-left:10px;padding-top:10px;"

Below is the style for the Radio Buttons

style="background-color:blue;color:white;display:inline-block;padding:5px;"

Add a C# Dropdown to a Bootstrap Modal Dialog

This example combines C# and Bootstrap to create a bootstrap modal dialog containing an asp dropdown and an asp button to retrieve...

Continue Reading

Use C# to Populate Dropdown Lists With XML

The code below opens an xml file, reads the data from the xml file, dynamically adds a label for the dropdown list, and adds the dropdown list to the asp.net page...

Continue Reading

Add Style Properties to ASP.Net Controls to Improve Appearance

The default formatting for ASP.Net controls is very dated.  The default formatting is basically the same as the formatting in Visual Basic 1.0 ...

Continue Reading

Export To A Text File From A DataGridView Control

Add a button control to Form1.
Add a DataGridView Control to Form1....

Continue Reading