473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Few questions on custom controls

While creating a custom control, what is the difference between

Public Class MyCls : Inherits Control

&

Public Class MyCls : Inherits WebControl

Also when should the sub Render be used & when should the sub
RenderContents be used?

Also does it make any sense in using the sub AddAttributesToRender if
the class is being inherited from the WebControl class since the
WebControl class will always render a <spanelement?

Nov 4 '06 #1
1 1075
You should inherit from Control when your custom control doesn't have much
of any UI to display.
Inheriting from WebControl gets you everything that Control supplies plus
some extra UI goodies, such as CSS support and some other fancy UI goodies.

As for which rendering method you should use I suggest you read about
composition vs. rendering:
http://msdn.microsoft.com/library/de...srendering.asp

http://SteveOrr.net/articles/BarGraphs.aspx

And for more info about your final question I suggest you read this link:
http://geekswithblogs.net/mcastro/ar.../19/66393.aspx

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
<rn**@rediffmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
While creating a custom control, what is the difference between

Public Class MyCls : Inherits Control

&

Public Class MyCls : Inherits WebControl

Also when should the sub Render be used & when should the sub
RenderContents be used?

Also does it make any sense in using the sub AddAttributesToRender if
the class is being inherited from the WebControl class since the
WebControl class will always render a <spanelement?

Nov 6 '06 #2

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

Similar topics

3
by: Tom Bean | last post by:
I am using Dotfuscator Community Edition to obfuscate an application for Pocket PC written in C#. When I made the first pass with Dotfuscator, the app threw a MissingManifestResourceException. Of...
5
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose...
1
by: Sky | last post by:
Although I've been using C# for the last month or so, and accepting out of blind faith the ViewState, I do have some nagging questions about it... can you help verify the following statements? ...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
0
by: Michael.Suarez | last post by:
So we develop and maintain several applications used by several people in the same company, on the same intranet. There are several applications written in VB6, but going forward all of the new...
2
by: J R M | last post by:
I've developed a custom control (it's basically a drop-down list and then a couple of textboxes to include meta-data for the selection) that I'm embedding into another custom control (the idea is...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
by: Rune Jacobsen | last post by:
Hi all, I have a few questions on deriving from ScrollableControl that I hope will be relatively easy to answer. I am using Visual Studio 2003, C# and ..Net 1.1. I have this custom control I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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
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...
0
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
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,...
0
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...

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.