473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Need help with skin file for Usercontrol


I'm very confused about how this works, all the tutorials out there
show me how to apply a skin to a webcontrol, but I want to know how
I can access the components of a control....for example:

I have a usercontrol, the ascx is defined like this:

<%@ Control Language="C#" AutoEventWireup="true"
CodeFile="Test.ascx.cs" Inherits="Spin.Test" %>

<asp:Panel ID="Panel1" runat="server" Height="243px" Width="350px">
<asp:Label ID="header1LBL" runat="server" Height="25px"
Width="100%">Header</asp:Label>
<asp:Label ID="infoLBL" runat="server" Height="25px"
Width="100%">Subheader</asp:Label>
<asp:Label ID="contentLBL" runat="server" Height="100%"
Width="100%"></asp:Label>
</asp:Panel>

Now, how can I skin this component in a skin file and tell it to, for
example:

*) Assign a width of 100% to the "Panel1"
*) Make the text for "header1LBL" bold,
*) make the text for "infoLBL" smaller
*) make the background color for "contentLBL" blue

I have registered the usercontrol in my skin file like this:

<%@ Register Src="../../Test.ascx" TagName="Test" TagPrefix="uc1" %>

but beyond that, I'm completely clueless!
Thanks in advance,

Philipp Lenz
Dec 4 '05 #1
1 2991
The controls used within your usercontrol are not directly accessible by
the consuming page. If you want to be able to manipulate the properties
of contained controls (for skinning, etc), you need to make them
available through public properties on the usercontrol.

Add a Width property to your usercontrol which sets the width of the Panel.
Add a HeaderStyle property to your usercontrol which sets the style for
header1LBL.
Add a SubHeaderStyle property to your usercontrol which sets the style
for header1LBL.
Add a ContentStyle property to your usercontrol which sets the style for
header1LBL.

Joshua Flanagan
http://flimflan.com/blog
Philipp Lenz wrote:
I'm very confused about how this works, all the tutorials out there
show me how to apply a skin to a webcontrol, but I want to know how
I can access the components of a control....for example:

I have a usercontrol, the ascx is defined like this:

<%@ Control Language="C#" AutoEventWireup="true"
CodeFile="Test.ascx.cs" Inherits="Spin.Test" %>

<asp:Panel ID="Panel1" runat="server" Height="243px" Width="350px">
<asp:Label ID="header1LBL" runat="server" Height="25px"
Width="100%">Header</asp:Label>
<asp:Label ID="infoLBL" runat="server" Height="25px"
Width="100%">Subheader</asp:Label>
<asp:Label ID="contentLBL" runat="server" Height="100%"
Width="100%"></asp:Label>
</asp:Panel>

Now, how can I skin this component in a skin file and tell it to, for
example:

*) Assign a width of 100% to the "Panel1"
*) Make the text for "header1LBL" bold,
*) make the text for "infoLBL" smaller
*) make the background color for "contentLBL" blue

I have registered the usercontrol in my skin file like this:

<%@ Register Src="../../Test.ascx" TagName="Test" TagPrefix="uc1" %>

but beyond that, I'm completely clueless!
Thanks in advance,

Philipp Lenz

Dec 4 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Dell | last post by:
I have a problem comparing strings in an order form i'm writing. I want to give a running total at the bottom of the page and it appears to be working except it doesn't compare correctly (it...
2
by: Holger (David) Wagner | last post by:
Hi all, I'd like to have several "skins" for an application that are "structurally different" (i.e. controls at different locations, some controls visible only in a particular "skin"). The...
1
by: Andre | last post by:
Hi, I'm using Visual Web Developer 2005 to create a .skin file. But i have a problem (i think) ;o) When editing my skin file, in the toolbox, i can only drag HTML controls.. the Server...
0
by: Kelvin.YuShen | last post by:
Hello there, I got a problem when I was uploading the skin I developed. Following is the code from my original skin template (skin.htm): <TABLE cellspacing="3" cellpadding="3" width="100%"...
2
by: Tina | last post by:
I have a css class... ..TopTypeColor { color: white; } I have an entry in my skin file... <asp:SiteMapPath CssClass="TopTypeColor" runat="server"> </asp:SiteMapPath> This works well...
0
by: Matthew Brealey | last post by:
I have the following entry in a .skin file: <asp:button runat=server SkinId=btnSubmit ImageUrl="~/Images/ submit.gif" /> But I want to make the image an embedded resource in a different...
5
by: smileskhan | last post by:
Hay Friends... Here I started a new and interested thread. I hope you also enjoy it. I got a task to creat a Hospital Database in Java. But I donīt have any good clues abouts it....
14
by: WT | last post by:
Hello, I have a usercontrol loaded in a page with a theme. This usercontrol contains columns template with hyperlinks, with skinID. The columns are not displayed, seems thta there is some...
11
by: Peted | last post by:
Im using c# 2005 express edition Ive pretty much finished an winforms application and i need to significantly improve the visual appeal of the interface. Im totaly stuck on this and cant seem...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.