net5:Theme主题样式的动态变换,在内容页content中操作影响模板页的操作

2021-06-29 06:06

阅读:461

标签:uri   tar   font   导入   text   hang   webpart   文章   page   

原文发布时间为:2008-07-29 —— 来源于本人的百度文章 [由搬家工具导入]

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Request.QueryString["t"] != null)
        {
            Page.Theme = Request.QueryString["t"].ToString();
        }
    }
   
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default2.aspx?t=blue");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default2.aspx?t=red");
    }
}

---------------------------------------------------------------------------

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        ((Label)(Master.FindControl("Label1"))).Text = DropDownList1.SelectedValue;
        Label1.Text = DropDownList1.SelectedValue;
    }
}

---------

App_Themes文件夹中的blue文件夹文件SkinFile文件内容如下:

            CellPadding="4" DataKeyNames="au_id" ForeColor="#333333"
            GridLines="None">
           
           
               
               
               
           

           
           
           
           
           
           
       
       
       
       
           
           
           
           
           
           
       
       
                   Font-Names="Arial Black">
            fgh
            jdf
            dfgh
       

StyleSheet文件内容如下:

body
{
color: blue;
font-style: italic;
font-family: 'Arial Black';
background-color: #ff33ff;
}

-----------------------

App_Themes文件夹中的red文件夹文件SkinFile文件内容类似

net5:Theme主题样式的动态变换,在内容页content中操作影响模板页的操作

标签:uri   tar   font   导入   text   hang   webpart   文章   page   

原文地址:http://www.cnblogs.com/handboy/p/7141607.html


评论


亲,登录后才可以留言!