|
ASP.NET Book
The online ASP.NET Tutorial Book |
|||||||||
|
|
|||||||||
ASP.NET BasicsHTML BasicsASP.NET Web Server Advanced HTML Application Designing Using Visual Studio ASP.NET Standards ASP.NET Styling ASP.NET Navigation ASP.NET TipsASP.NET ValidationHTML forms CSS Styling CSS Advanced ASP.NET Features ASP.NET Image Effects Common mistakes DB Design tips Building ApplicationsDesign Secure AppsBuild Secure Apps |
1.2 Inline/Hardcoding Styles |
||||||||
|
The other styling technique you can use when developing a Website with ASP.NET is through a Visual Control’s Properties. For example:
When styles are applied using the properties window of the ASP.NET Control, the style information is stored in the control’s markup. This type of Styling is called inline styling as styling details like the font, color, and border width are all defined in the code of the control. Inline styling method hardcode markup values and this is not recommended by many programmers. Below is a code snippet of the GridView control showing hardcoded inline Styles added to it via the Properties Window.
<asp:GridView ID="GridView1" Inline styling can be easy to apply, but as your website becomes larger and more complex, it might be a difficulty to maintain consistency throughout. For instance, if you decide to change Border Color used on the grid, you would need to open every individual page and find the Control and go to the Properties window and change the Border Color value. This is the reason why many programmers like to store Styles in a common place which can be accessed and applied to the whole web site (will be shown in Chapter that follow). Table of ContentsChapter 1 - Placing Style Rules [top] |
|||||||||