473,888 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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%">He ader</asp:Label>
<asp:Label ID="infoLBL" runat="server" Height="25px"
Width="100%">Su bheader</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 3030
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%">He ader</asp:Label>
<asp:Label ID="infoLBL" runat="server" Height="25px"
Width="100%">Su bheader</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
2051
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 always adds things up when you didn't select them) so i only added 2 of the items until I got it worked out. here's the page source (you can look at it yourself at http://robertdell.dyndns.org/shifts/ <!DOCTYPE HTML PUBLIC> <html> <head>
2
1823
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 application is implemented with a single default.aspx which loads a couple of ascx-Controls (navigation, contents depending on parameter and so on). Now, an obvious approach is simply duplicating the ascx-Files into an own directory structure which...
1
1312
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 Control (In the Standard section of the toolbox) are disabled. In skin file we can only put server control, so, is it a problem or i'm missing something ?
0
2221
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%" border="0"> <TR> <TD class="toppane" colspan="3" valign="top"
2
3072
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 enough to make my current node white but I want all the
0
1194
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 assembly, using WebResource.axd. How can I do this?
5
2650
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. So I also try my best to do it well. But here I posted it for friends too. If you have any perfect idea or correct code about it, so Please send it. I shall wait for your nice comments and help. Here I also explain about my task..........Hospital...
14
2027
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 not traceable exception triggered and the all binding is stopped. But this same named skinid is working for hyperlinks outside templates.
11
3396
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 to work out how to start on a solution. I have of course used a varienty of componets, mostly radio buttons with "button" appearence.
0
9961
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9800
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11178
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10438
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9597
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7148
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6014
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4642
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3251
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.