I set a theme folder with a skin folder in it.. with this inside:
<asp:Label Runat="server" Font-Size="Large" Font-Bold="True" Font-Italic="True"/>
My page directive:
<%@ Page Title="" Language="C#" MasterPageFile="~/YourGuruMaster.master" AutoEventWireup="true" CodeFile="AnswerQuestion.aspx.cs" Inherits="AnswerQuestion" StylesheetTheme="AnswerDesign"%>
The code beh开发者_Python百科ind where i set the label automatically:
Label title = new Label();
title.SkinID = "Blue";
title.Text = QuestionRequest;
PlaceHolder2.Controls.Add(title);
At the first you are miss the SkinID property in label skin. And as you add label dynamically use Theme Page's directive attribute instead of the StylesheetTheme.
Follow this link for clarification why you must use Theme property in this case: Page.StyleSheetTheme Property
精彩评论