Change Skin of an UserControl in side a page dynamically RRS feed

  • Question

  • User-294837681 posted

    Hello friends,

    I have an usercontrol with a skin id 

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="test.ascx.cs" Inherits="test" %>
    <asp:Button SkinID="skin1" ID="btnTest" runat="server" Text="Test"/>

    And i use this usercontrol in one of the pages


    <%@ Register Src="test.ascx" TagName="Export" TagPrefix="uc1" %>

    Now I want to change the Skin of the usercontrol to "skin2" dynamically in test.aspx.cs

    I tried to do it Page_PreInit as btnTest.SkinId="Skin2", But btnTest Always was null,

    I tried to do it in OnInit of the test.aspx.cs page too, but it did not help, Please let me know the possible solution ;)

    Sunday, August 26, 2012 5:54 AM

All replies