473,766 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server control and themeing

Hello newsgroup,

the following problem turns me mad. It would be great if anyone could have a
look at it and maybe give me some hint.

I have developed a server control, which should be adjustable via themeing
and style sheets.
The server control itself inherits from WebControl and has for example these
three properties:
DisplayHeader() As Boolean
Title() As String
Header() As Label
(complete code see at the end of this post.)

During the rendering process the Label is added to the child controls,
depending on the DisplayHeader flag.

After adding such an object to a .aspx-site, all properties and design
values can be set and are interpreted correctly.
The problem is in the themeing. If I set up a theme for the .aspx-site and
append a style template to the proper .skin file not all properties are
being transferred to the object on the site.
The DisplayHeader flag is transferred correctly but all properties of the
label just seem to be ignored.
Maybe I am just missing an adequate attribute?

Does anyone have an idea?

Nico Ploner

Here is the code:
===Default.aspx
[...]
<form id="form1" runat="server">
<div>
<tp:Test runat="server" ID="tl">
<Header Text="Hello"></Header>
</tp:Test>
</div>
</form>
[...]

===Theme.skin
<tp:Test runat="server" DisplayHeader=" true">
<Header backcolor="aqua marine"></Header>
</tp:Test>

===Test.vb
Imports System
Imports System.Componen tModel
Imports System.Security .Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.W ebControls

Namespace nsTest
< _
AspNetHostingPe rmission(Securi tyAction.Demand , _
Level:=AspNetHo stingPermission Level.Minimal), _
AspNetHostingPe rmission(Securi tyAction.Inheri tanceDemand, _
Level:=AspNetHo stingPermission Level.Minimal), _
DefaultProperty ("Content"), _
ToolboxData( _
"<{0}:Test runat=""server" "></{0}:Test>") _
_
Public Class Test
Inherits WebControls.Web Control

Private _bDisplayHeader As Boolean
Private _Header As Label

' returns if the title is to be displayed or sets it
Public Property DisplayHeader() As Boolean
Get
Return _bDisplayHeader
End Get
Set(ByVal value As Boolean)
_bDisplayHeader = value
End Set
End Property

' returns the text of the title or sets it
Public Property Title() As String
Get
Return Header.Text
End Get
Set(ByVal value As String)
Header.Text = value
End Set
End Property

' returns the appearance of the title
< _
Bindable(True), _
Category("Appea rance"), _
DefaultValue("" ), _
Description("Th e appearance of the header."), _
DesignerSeriali zationVisibilit y( _
DesignerSeriali zationVisibilit y.Content), _
PersistenceMode (PersistenceMod e.InnerProperty ) _
_
Public Property Header() As Label
Get
If _Header Is Nothing Then _Header = New Label
Return _Header
End Get
Set(ByVal value As Label)
_Header = value
End Set
End Property
' object rendering
Protected Overrides Sub RenderContents( ByVal writer As
System.Web.UI.H tmlTextWriter)
'check if the header is to be displayed
If _bDisplayHeader Then
'insert the header to the child controls
Me.Controls.Add (Header)
End If

MyBase.RenderCo ntents(writer)
End Sub
End Class
End Namespace
May 7 '07 #1
0 952

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

Similar topics

12
12432
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank, 'height=200,width=400,status=no,toolbar=no, menubar=no,location=no resizable=no scrollable=no'); but I can't seem to invoke the client side script from within a Server Side Form. I know I can use the context with to Response.redirect or Server.transfer to return a
2
8403
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
2
3182
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the problems that I have encountered to date and the solutions (if any) that I found. http://users.adelphia.net/~brianpclab/ServerControlCollectionIssues.htm This page also has all of the source code in a compressed file that you are free to download...
4
1976
by: clintonG | last post by:
Technically speaking, this issue is not about modifying the HTML generated by server controls but preceding the HTML generated by server controls with an HTML control generated on the basis of the type and the context of the server control itself. Clear as mud? :-) Consider the following server control... <asp:textbox id="MemberEmail" runat="server" ></asp:textbox> TextBox renders at run-time as an HTML control... <input...
9
2227
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see) in page_load, or elsewhere, that says page.validate, no control says "causesvalidation=true", and the AutoEventWireup is set to false. So I would think that the control's server event function would NOT execute, but it does execute right after...
20
5650
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just client-side HTML, CSS, etc. What I want to do is somehow insert a *server control* into the , then set the server control's properties at runtime.
7
3017
by: Shimon Sim | last post by:
I have a custom composite control I have following property
5
3595
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact that for server control component , code is running on the server side. But if I take as example a Label. I place on a webform an HTM label control and a WebForm label control, I could see that properties are different for
2
4924
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is being updated by some other process through remoting. When the page loads, I init the tree, and in my browser I can see the initialized tree. The problem is that every time that I receive update to tree from the remote process,
0
9568
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
10008
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
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...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
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
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.