472,780 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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:
<form id="form1" runat="server">
<tp:Test runat="server" ID="tl">
<Header Text="Hello"></Header>

<tp:Test runat="server" DisplayHeader="true">
<Header backcolor="aquamarine"></Header>

Imports System
Imports System.ComponentModel
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace nsTest
< _
AspNetHostingPermission(SecurityAction.Demand, _
Level:=AspNetHostingPermissionLevel.Minimal), _
AspNetHostingPermission(SecurityAction.Inheritance Demand, _
Level:=AspNetHostingPermissionLevel.Minimal), _
DefaultProperty("Content"), _
ToolboxData( _
"<{0}:Test runat=""server""></{0}:Test>") _
Public Class Test
Inherits WebControls.WebControl

Private _bDisplayHeader As Boolean
Private _Header As Label

' returns if the title is to be displayed or sets it
Public Property DisplayHeader() As Boolean
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
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("Appearance"), _
DefaultValue(""), _
Description("The appearance of the header."), _
DesignerSerializationVisibility( _
DesignerSerializationVisibility.Content), _
PersistenceMode(PersistenceMode.InnerProperty) _
Public Property Header() As Label
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
'check if the header is to be displayed
If _bDisplayHeader Then
'insert the header to the child controls
End If

End Sub
End Class
End Namespace
May 7 '07 #1
0 915

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

Similar topics

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,...
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...
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...
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...
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)...
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...
by: Shimon Sim | last post by:
I have a custom composite control I have following property
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...
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...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: lllomh | last post by:
How does React native implement an English player?
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.