Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET Custom Controls - Composites
    primarykey
    data
    text
    <h2>Summary</h2> <p>Hi All,<br> OK, further into my adventures with custom controls...</p> <p>In summary, here is that I have learned of three main "classes" of custom controls. Please feel free to correct me if any of this is wrong! </p> <ol> <li><strong>UserControls</strong> - Which inherit from <em>UserControl</em> and are contained within an <em>ASCX</em> file. These are pretty limited in what they can do, but are a quick and light way to get some UI commonality with designer support.</li> <li><strong>Custom Composite Controls</strong> - These are controls that inherit from <em>WebControl</em> where you add pre-existing controls to the control within the <em>CreateChildControls</em> method. This provides great flexibility, but lack of designer support without additional coding. They are highly portable though since they can be compiled into a DLL.</li> <li><strong>Custom Rendered Controls</strong> - Similar to Custom Composite Controls, these are added to a Web Control Library project. The rendering of the control is completely controlled by the programmer by overriding the <em>Render</em> method.</li> </ol> <h2>My Thoughts..</h2> <p>OK, so while playing with custom composites, I found the following:</p> <ul> <li>You have little/no control over the HTML output making it difficult to "debug".</li> <li>The <em>CreateChildControls</em> (and subsequent methods) can get real busy with <em>Controls.Add(myControl)</em> everywhere.</li> <li>I found rendering tables (be it for layout or content) to be considerably awkward.</li> </ul> <h2>The Question(s)..</h2> <p>So, I admit, I am new to this so I could be way off-base with some of my points noted above..</p> <ul> <li>Do you use Composites?</li> <li>Do you have any neat tricks to control the HTML output?</li> <li>Do you just say "to hell with it" and go ahead and create a custom rendered control?</li> </ul> <p><strong>Its something I am keen to get really firm in my mind since I know how much <em>good</em> control development can cut overall development time.</strong></p> <p>I look forward to your answers ^_^</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload