2012-03-22 73 views
2

我開發一個網站在ASP.Net應用主題和皮膚文件在CSS的.. 是因爲我們在HTML中使用它良好的開發使用與主題或SkinFile CSS樣式優勢在asp.Net

哪個最好?

回答

1

主題與層疊樣式表

主題類似於在級聯樣式表兩個主題和樣式表定義了一組可以應用到任何網頁常用屬性。然而,主題從樣式表不同,在以下幾個方面:

* Themes can define many properties of a control or page, not just style properties. For example, using themes, you can specify the graphics for a TreeView control, the template layout of a GridView control, and so on. 
* Themes can include graphics. 
* Themes do not cascade the way style sheets do. By default, any property values defined in a theme referenced by a page's Theme property override the property values declaratively set on a control, unless you explicitly apply the theme using the StyleSheetTheme property. For more information, see the Theme Settings Precedence section above. 
* Only one theme can be applied to each page. You cannot apply multiple themes to a page, unlike style sheets where multiple style sheets can be applied. 

Please go to msdn for more detail:

+0

這與我的回答有何不同?同一鏈接.. – Kaf 2012-03-22 11:40:35

+0

@Kaf:對不起。我沒有檢查你的鏈接。 – 2012-03-22 12:15:20

0

ASP.NET控件可以使用皮膚文件設置屬性。例如,您可以定義一個網站上的每個按鈕需要以下屬性:

<asp:Button runat="server" 
    BackColor="Red" 
    ForeColor="White" 
    Font-Name="Arial" 
    Font-Size="9px" /> 

這是概括的造型爲你的網站,但沒有什麼不能單獨使用CSS來完成一個方式。

0

關於你的問題,如果你需要的是什麼造型,那麼我會建議CSS的方式,特別是因爲的性能優勢,因爲它可以被緩存,並且不會在服務器中造成任何開銷。