ASP.NET 2.0, AppTheme: How can we utilize AppTheme in best way for my ASP.NET WEBSITE

杀马特。学长 韩版系。学妹 提交于 2019-12-12 05:18:55

问题


I am writing asp.net website which will going to be host on public network. I don't have very much knowledge about AppTheme specially utilizing theme, css and skin in asp.net 2.0.

Previously i have worked with asp and asp.net 1.0 where i only write css class and write attribute class="***" inside every control where i want to have css.

I don;'t know whether this is right practice with asp.net 2.0 because in asp.net 2.0 we have advance features like theme and skins.

So can i have help from you so that i can use theme, css and skin in best way . Also i would like to know how different is using css with asp.net 2.0 AS COMPARE WITH PREVIOUS VERSION.


回答1:


Themes are made up of a set of elements: skins, cascading style sheets (CSS), images, and other resources. At a minimum, a theme will contain skins. Themes are defined in special directories in your Web site or on your Web server.

Here are some links from MSDN that will help you get started:

  • ASP.NET Themes and Skins Overview
  • How to: Define ASP.NET Page Themes
  • How to: Apply ASP.NET Themes
  • How to: Apply ASP.NET Themes Programmatically
  • Walkthrough: Creating User-Selectable Themes

Also, I would recommend Scott Allens article on Themes In ASP.NET 2.0 for a quick overview and some samples: http://www.odetocode.com/articles/423.aspx




回答2:


Your work shouldn't change that much (if you're working with a single theme).

  1. Your CSS classes will stay as they are at the moment - they'll be used on the client side
  2. You'll add skin files to your theme - these are used for server control style settings

The main difference is that you're able to define several different themes at the same time. Otherwise it depends on you how simple your HTML is. The best way is to not include any style information inside your ASPX files. You should use only use classes. Everything else should be styled within your CSS files.

Oh and BTW: all your CSS files within your App_Themes/Theme folder will be automagically added to your pages. You don't have to explicitly add them to your Master/Aspx page.



来源:https://stackoverflow.com/questions/1163211/asp-net-2-0-apptheme-how-can-we-utilize-apptheme-in-best-way-for-my-asp-net-we

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!