2011-07-10 55 views
0

我将与它的皮肤文件夹中的主题文件夹..这个里面:主题化不工作

<asp:Label Runat="server" Font-Size="Large" Font-Bold="True" Font-Italic="True"/> 

我的页面指令:

<%@ Page Title="" Language="C#" MasterPageFile="~/YourGuruMaster.master" AutoEventWireup="true" CodeFile="AnswerQuestion.aspx.cs" Inherits="AnswerQuestion" StylesheetTheme="AnswerDesign"%> 

背后,其中我的代码自动设置标签:

 Label title = new Label(); 
    title.SkinID = "Blue"; 
    title.Text = QuestionRequest; 
    PlaceHolder2.Controls.Add(title); 

回答

0

首先,您错过了标签外观中的SkinID属性。而且,当您动态添加标签时,请使用Theme Page的指令属性而不是StylesheetTheme。

请按此链接进行说明为什么您必须在此情况下使用Theme属性:Page.StyleSheetTheme Property