473,507 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A question of (web)control and CssClass

I am doing a custom control.
It contains a label and a textbox and a button.
The class inherits WebControl.

Thus the control gets a property CssClass visible in the Properties window.

Question 1. Is it possible to override this property AND give it another
name, for example CssClassLabel?
Is it ugly doing it as a CSV-property type "cssstyle1,cssstyle2,cssstyle3"?

Since the control contains three controls I need to give CssClass-properties
for each containde control.

Question 2: Is this possible without resorting to prepertyname like
CssClassLabel, CssClassButton etc.
I have seen that Font has subnode in the properties window.

Question 3: Is this possible in my own code? Type: CssClasses containg three
subnodes: CssClassLabel, CssClassButton and so on
/k
Jan 17 '06 #1
1 1628
> Question 1. Is it possible to override this property AND give it another
name, for example CssClassLabel?
No; you can override it by giving it the same name, or create another
property with a different name, but not a property with a different
name that acts as a new virtual implementation. If you need to override
the base class functionality for calls from the base class (i.e. use it
as a virtual method), you'll need to create a property (CssClass) with
the same name using the 'override' modifier; you could then create
another property (CssClassLabel) and make trivial accessors that just
call your overridden version.

I doubt you *really* want to do this, though, especially given your
other questions. If the 'Label' style overrides the inherited CssClass,
then what happens to the others?
Is it ugly doing it as a CSV-property type "cssstyle1,cssstyle2,cssstyle3"?
Yes, somewhat. But it'll work...
Since the control contains three controls I need to give CssClass-properties
for each containde control.
Question 2: Is this possible without resorting to prepertyname like
CssClassLabel, CssClassButton etc.
Well, it might be, but I'm not sure *why* you'd particularly want to.
I have seen that Font has subnode in the properties window.
Question 3: Is this possible in my own code? Type: CssClasses containg three
subnodes: CssClassLabel, CssClassButton and so on


Not so far as I know

Jan 17 '06 #2

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

Similar topics

2
2656
by: Carolyn Vo | last post by:
I have been looking and looking but can't seem to find out how to get the row selected in a web control datagrid (NOT a web form datagrid!!!), and how to highlight the selected row. I'm sure this...
10
1901
by: dale zhang | last post by:
Hi, I saw the post here about setfocus. But they are for web form. Web control page HTML does not have form1. the Jscript there does not work here. My question is how to set focus to the...
7
2705
by: Tuckers | last post by:
Hi, I am exploring c#. I want to reference a c# web control in a web page much like you can with an activeX control. The syntax for doing this in ActiveX is something like <OBJECT...
2
1035
by: JezB | last post by:
A web control can have a ForeColor property, a Style collection which can define a "color" property, and a CssClass property which also defines a "color" property. Which takes precedence? Is...
1
3393
by: William Parker | last post by:
I have a web control I made called header.ascx. It has its own properties and methods I defined. But I cannot figure out how to access this control from my code behind page. I can create the...
4
1397
by: DotNetJunkies User | last post by:
I have created a User Control (a Pareto Chart) using C#. It works great in .Net Windows Apps, but I also need to use it in a Web Application (to view in IE). Everything I read on this seems to be...
2
2162
by: Miky | last post by:
Hi, I have the following problem: I have a .CFM web page and I have to populate, from VB, two textboxes on it. I was thinking using sendkeys (even if I don't like it too much) but when I...
4
2134
by: Sam Martin | last post by:
Hi, I have got a User Control that contains for the sake of argument, a single DataList control. eg. <asp:DataList id="DataListMain" runat="server" RepeatDirection="Horizontal"...
0
1586
by: pabloazorin | last post by:
I developed a Date Picker web control using C# and .net framework 1.1 I added my control to Visual Studio 2003 IDE toolbar. When I drag and drop my control to design web page, the control renders...
5
3724
by: John Kotuby | last post by:
Hi all, This is my first time trying to creaet and use a custome Web Control in a Web Site project in ASP.NET 2.0 with VS 2005 and VB. I created the control in a separate Web Control Library...
0
7321
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
7377
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...
1
7034
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...
0
7488
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...
0
5623
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,...
1
5045
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...
0
4702
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
412
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...

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.