If you are using Sharepoint you perhaps like to create your own Controls.
There are differend Ways to create them, you may inherrit from, Controls, UserControls , Webcontrols,Composite Controls. Some have advantages some not.
If you create your own Controls using the Webcontrols, you may have Problems with creating Webcontrols in the the VS 2008 Sp1. The Events wont work, and you are not able to drag and Drop the Controls into your Toolbox, for using them, thre this is only Minimal support for use in a designer.
WebControls are good for application-specific functionality but they are saved as a text file with an .ascx extension (with an optional code-behind file) instead of being precompiled in an assembly.
Composite Controls instead, are Pre-Compiled and persisted as an assembly (.dll) , are able to be used in a toolbox of a visual designer and so easy dragged and dropped onto a page. They are well suited to authoring generic redistributable controls.
If you use them in a updatepanel you have to be shure that you wont, re initialize them in every post back, because the Events may be overwritten and therfore you have Problems in fireing them, wont you
So you have to recreate them in GetChildcontrols And Save them into the Viewstate on The Render Contents Method,
if you are not Shure of the Lifecycle , read this Link:http://www.15seconds.com/issue/020102.htm

![]()
This is an Example of an ImageButton and a TreevIew Composition

First we Have to create a Viewstate of the Controls, and if you like you are able to influence the design by overwriting the Render Contens Method.

than we can Load the State everytime we create the ChildControls

Open your Webconfig in your Virtual Directory
for example : C:\Inetpub\wwwroot\wss\VirtualDirectories\80
In the web.config you’ll find included a <sharepoint> Tag. In the SafeMode Tag you have to enable the Callstack property to true. Further you’ll find a <compilation> Tag you have set the debug to true. After you safed this, you will recive a more detailed debbuging Information as Error Message displayed in your Sharepoint.
