Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 27, 2012 01:54 PM by Rac19
Member
251 Points
151 Posts
Aug 26, 2012 09:54 AM|LINK
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
Test.aspx
<%@ 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 ;)
Participant
1339 Points
622 Posts
Aug 27, 2012 05:38 AM|LINK
solved here - http://forums.asp.net/t/951040.aspx
hope it helps..
Aug 27, 2012 01:54 PM|LINK
I had already tried it, it does not work :(
Any other alternative...............?
Rac19
Member
251 Points
151 Posts
Change Skin of an UserControl in side a page dynamically
Aug 26, 2012 09:54 AM|LINK
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
Test.aspx
<%@ 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 ;)
Rac19
DreamBig
Participant
1339 Points
622 Posts
Re: Change Skin of an UserControl in side a page dynamically
Aug 27, 2012 05:38 AM|LINK
solved here - http://forums.asp.net/t/951040.aspx
hope it helps..
My Blog
Rac19
Member
251 Points
151 Posts
Re: Change Skin of an UserControl in side a page dynamically
Aug 27, 2012 01:54 PM|LINK
I had already tried it, it does not work :(
Any other alternative...............?
Rac19