zoukankan      html  css  js  c++  java
  • 【Asp.net从零开始】:使用主题(Theme)

    主题十分简单。。。按MSDN的链接演练来练练即可http://msdn.microsoft.com/zh-cn/library/bb515247#designing_the_look_and_layout_of_a_web_site

    下面写几点需要注意的:

    一.APP_Theme文件夹中的不同主题包括的内容有:皮肤(skin),CSS样式,图片和其他资源

    二.Within Asp.Net, attributes and elements take precedence in the following order:(主题选择的优先顺序,主要还是依赖于生命周期来确定的)

    1.Theme attributes in the @Page directive (@Page中的Theme属性)

    2.<pages Theme="themeName"> elements in the <system.Web> section of a Web.config file(Web.config 中 <pages>的Theme设置)

    3.Local control attributes(本地控件自身的属性设置)

    4.StyleSheetTheme attributes in the @Page directive(@Page中的StyleSheetTheme属性)

    5.<pages StytleSheetTheme="themeName"> in Web.config(Web.config中<pages>的StytleSheetTheme属性)

    三.更换皮肤时需要指明 SkinID , ImageUrl

    四.编程动态更改主题的示例:

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_PreInit(object sender, EventArgs e)
        {
            if ((string)Session["masterName"] == null)
                MasterPageFile = "~/Master1.master";
            MasterPageFile = (string)Session["masterName"];
            
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            
            
        }
    
    
        protected void submit(object sender, EventArgs e)
        {
            if (DropDownList1.SelectedItem != null)
            {
                Session["masterName"] = DropDownList1.SelectedItem.Value.ToString();
                Response.Redirect(Request.Url.ToString());
            }
        }
    }
    

      

  • 相关阅读:
    消息中间件的研究(二) RabbitMQ应用场景分析
    消息中间件的研究 (一)
    35. 搜索插入位置
    374. 猜数字大小
    278. 第一个错误的版本
    367. 有效的完全平方数
    1.Storm概述简介
    7.MapReduce操作Hbase
    6.Hbase 原理
    5.Hbase API 操作开发
  • 原文地址:https://www.cnblogs.com/VortexPiggy/p/2629909.html
Copyright © 2011-2022 走看看