473,750 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server Control Within Server Control

I'm developing a server control that in turns contains another server control
(i.e. Label). I instantiate the label and expose the entire Label through a
property.
Imports System
Imports System.Web
Imports System.Web.UI

Public Class Class1
Inherits Control

Dim _label As New WebControls.Lab el
Public Property L() As WebControls.Lab el
Get
Return _label
End Get
Set(ByVal Value As WebControls.Lab el)
_label = Value
End Set
End Property

Dim _t As String
Public Property T() As String
Get
Return _t
End Get
Set(ByVal Value As String)
_t = Value
End Set
End Property
End Class

I then add this control to the toolbar and drag it to an aspx page. As you
can see in the picture I have my two properties "L" (the label with the +
sign for all the properties of the label) and the "T" (string)

If I set the "T" property I will get this in the html:
<cc2:Class1 id="Class11" runat="server" T="Hello World"></cc2:Class1>
Which is the reason why it gets persisted when I close and open the webform.
But if I expand the L property and set any of the properties of the label
nothing changes in the html and when I close and open the webform all the
properties from the Label get blanked out.

If I go to the HTML and manually add the property:

<cc2:Class1 id="Class11" runat="server" T="Hello World"
L-CssClass="Healy "></cc2:Class1> the changes will persist.

Basically, I need a way that when the properties of the label get changed in
the property pane they will get written to the html so they can get persisted

Feb 16 '06 #1
1 1128
"As you can see in the picture I have my two properties"

There are no pictures, please ignore...

JoNaS

"JoNaS" wrote:
I'm developing a server control that in turns contains another server control
(i.e. Label). I instantiate the label and expose the entire Label through a
property.
Imports System
Imports System.Web
Imports System.Web.UI

Public Class Class1
Inherits Control

Dim _label As New WebControls.Lab el
Public Property L() As WebControls.Lab el
Get
Return _label
End Get
Set(ByVal Value As WebControls.Lab el)
_label = Value
End Set
End Property

Dim _t As String
Public Property T() As String
Get
Return _t
End Get
Set(ByVal Value As String)
_t = Value
End Set
End Property
End Class

I then add this control to the toolbar and drag it to an aspx page. As you
can see in the picture I have my two properties "L" (the label with the +
sign for all the properties of the label) and the "T" (string)

If I set the "T" property I will get this in the html:
<cc2:Class1 id="Class11" runat="server" T="Hello World"></cc2:Class1>
Which is the reason why it gets persisted when I close and open the webform.
But if I expand the L property and set any of the properties of the label
nothing changes in the html and when I close and open the webform all the
properties from the Label get blanked out.

If I go to the HTML and manually add the property:

<cc2:Class1 id="Class11" runat="server" T="Hello World"
L-CssClass="Healy "></cc2:Class1> the changes will persist.

Basically, I need a way that when the properties of the label get changed in
the property pane they will get written to the html so they can get persisted

Feb 16 '06 #2

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

Similar topics

2
1806
by: luca | last post by:
I'm trying to build a Server Control, it's a calendar to manage sellers appointments (don't answer me to use and custumize Calendar Control because unluckily it's not possible for this specific project). A piece of my control's interface is composed of a table and in each of its cells are stored informations about a seller, a date and a time range. Each of these cells has to be an interactive element: I should be able to process datas...
0
1639
by: luca | last post by:
Hi all. My problem is that I can't handle events raised from child components within a composite server control when the control is created dynamically. Everything works fine if the same control is defined within an aspx page <MyTag:MyControl id="MyControl1" runat="server">: MyControl handle succesfully events raised from its children. When I try to create dynamically MyControl and to Add it to another control, event handling doesn't work...
2
3181
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...
7
1957
by: David | last post by:
i think i just realized i'm an idiot. again. (not syntactically correct code... just pieces to illustrate) class StateObject { members like socket, receiveBuffer, receiveBufferSize, StringBuilder etc.. }
4
1719
by: Jordan S. | last post by:
In a "standard" aspx page I can access the system cache (System.Web.Caching.Cache), like this: Cache = someObject; How can I access the same Cache from *within* a custom composite Web server control I'm writing (that lives in it's own assembly) that is dynamically added to a page at runtime? What do I need to do with the custom control or it's containing assembly to enable it to access the Cache of the hosting Web application?
0
8999
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
8836
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,...
1
9338
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
9256
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
8260
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...
1
6803
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
6080
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();...
1
3322
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
2223
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.