Viewing custom web control at design time

D

D Wicker

Hello,
I've created a custom web control (composite) and added to my toolbox. I
dragged the control onto a new web form and I see the small green box icon
for the control but can't figure out how to see the entire control at design
time. I have a Text property for the control and have set that property with
some text in the HTML for the web form. I read that by setting one of the
properties to some value
will cause the control to appear at design time. But that's not the case so
far. I still see the small green box icon. The control has buttons,
tables, and an image- so I'd like to see this all at design time. I see
everything just fine at run-time.

Any suggestions on how to get the control to appear at design time on my web
form?
Thanks!

Donnie
 
G

Giorgio Parmeggiani

Hi

Probably your control is rendered at runtime with some methods that are not
performed at designe time.

You can try to put in debug your control at design time
(http://www.microsoft.com/mspress/books/sampchap/5728e.asp -
http://www.fawcette.com/vsm/2003_01/online/hottips/lasker /) and it checks
if the methods are executed with which create the content of your composit
custom control at runtime.

If you want you can divide the code executed at runtime from that executed
at design time producing a new class that inherits from
System.Web.UI.Designer.ControlDesigner, to associate this class to your
control has to use the attribute:
[Designer(typeof(YourAssembly.YourClassInheritFromControlDesigner))]

Some links:
http://www.oreilly.de/catalog/aspdotnetnut/chapter/ch06.html
http://www.codeproject.com/aspnet/composite_controls.asp

Hi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top