DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 23 Aug 2007 13:18:51 -0000,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Abdo Haji-Ali
          2    Ladislav Mrnka


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
Date:Thu, 23 Aug 2007 13:18:51 -0000   Author:  

RE: WYIWYG way for creating Custom Controls   
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
> 
> 
Date:Thu, 23 Aug 2007 07:16:05 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us