Skinnable User Controls?

A

Andrew Clancy

Hi,

I'm hoping to create a skinnable user control in ASP.Net, using the skin
file to keep things streamlined & all in one place/technique. 1st attemp
went something like this
Test.ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Test.ascx.cs"
Inherits="Test" EnableTheming="true" %><asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox><asp:Button ID="Button1" runat="server"
Text="Button" />
Default.skin:
<%@ Register Src="~/Test.ascx" TagName="Test" TagPrefix="uc1" %>
<uc1:Test runat="server" />
Error Message: The control type 'ASP.test_ascx' cannot be themed

Anyone got any ideas if this is possible, and/or any examples references on
how?
Ideally I want to be able to do something like this so I can completely
customise the html/layout.

<%@ Register Src="~/Test.ascx" TagName="Test" TagPrefix="uc1" %>
<uc1:Test runat="server" ><template><asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox><asp:Button ID="Button1" runat="server"
Text="Button" /><template></uc1:Test>

Cheers,
Andy C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top