473,509 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WYIWYG way for creating Custom Controls


Previously I used to create user controls if I wanted to use a
specific set of controls in multiple pages, however I want to deploy
my control in other applications so I thought of creating custom
controls.
Only problem is that I'm used to designing my controls in a WYSIWYG
(tm) way (i.e. using the designer and writing HTML tags). The only way
I found to create custom controls was to create controls dynamically,
set their properties and render them all using pure code, something I
find really annoying.

So my question is: Is there a way I can create custom controls using a
designer and HTML tags only (i.e. without using so many writer.Write()
statements).

Thanks,
Abdo Haji-Ali
Programmer
TechnoLead

Aug 23 '07 #1
1 2169
Hi,
there is a way how to get "wysiwyg support when creating custom controls"
but it is not as easy as expected. First you need to inherit your control
from TemplateControl. Template control offers nice method called
ParseControl. You can put any well formated user control to this script and
it will create instance of user control class for you. Any ascx file can be
embedded as resource to your class library. So you can think about following
approach:

1. create new control library
2. in this library create new control by inheriting from TemplateControl
3. embedded user control (ascx) file to your control library
4. in Init handler of your custom control load resource from dll and create
user control instace by calling ParseControl
5. add created user control to controls collection

I have seen nice article about this somewhere, but I am not able to find it
now.

Regards,
Ladislav
"Abdo Haji-Ali" wrote:
>
Previously I used to create user controls if I wanted to use a
specific set of controls in multiple pages, however I want to deploy
my control in other applications so I thought of creating custom
controls.
Only problem is that I'm used to designing my controls in a WYSIWYG
(tm) way (i.e. using the designer and writing HTML tags). The only way
I found to create custom controls was to create controls dynamically,
set their properties and render them all using pure code, something I
find really annoying.

So my question is: Is there a way I can create custom controls using a
designer and HTML tags only (i.e. without using so many writer.Write()
statements).

Thanks,
Abdo Haji-Ali
Programmer
TechnoLead

Aug 23 '07 #2

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

Similar topics

0
1607
by: Jai | last post by:
Dear All Creating Custom Controls but Not User Controls,How to create custom controls,i.e Extending the functionality of the Existing Controls.(Web Custom Controls). Previously i have...
2
1785
by: Jim | last post by:
I'm a little new to the C# way of doing thisgs... Although I've done this sort of thing before in VS 6 / MFC... creatnig controls, ActiveX controls, etc. Creating controls in MFC is pretty...
3
1917
by: Kyle Fitzgerald | last post by:
I've started a web control library project and can build my own controls to add to the toolbox in the .NET environment. The problem I'm having is I want to create a control just like the HTML...
0
1211
by: Scott Yenor | last post by:
Hello, I am writing a control library that has a control that inherits from System.Web.UI.Control. The control works fine and I am able to loop through the child controls and display everything...
3
1844
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
0
1432
by: Julien | last post by:
Hi ! I'm creating a custom control, in which I would render an image with client-side script code to display/hide a calendar control which also belong to my custom control. In this control I've...
15
6477
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...
3
1921
by: =?Utf-8?B?R2hpc3Rvcw==?= | last post by:
Hi all, We have a N-Tier framework and we now create a Web Site App to wotk with this architecture. I add reference from my libraries in the project and creating page and controls is very...
0
1139
by: str1ker | last post by:
Hi, I've been working with C# for quite a while now, and I'd like to start creating programs which aren't the usual old regular Windows controls. I'd like to have controls which are graphically...
0
7342
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
7410
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
7067
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
5650
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
3215
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...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
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 ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
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.