Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are a few reasons you may use user controls, for example:</p> <ul> <li><strong>Modular code</strong>: instead of one bloated page class, you can partition the code into several user controls, each with less code. Thus, if your page has too much code to manage, splitting it up into user controls could reduce the size of each class.</li> <li><strong>Re-Use</strong>: if one control is used across several pages, or has several instances on one page, its much easier to build it once and then re-use it several times. Thus, if you have common UI components that are re-used in many places, user controls can help you.</li> </ul> <p>Of course there is a price to pay, each control has to expose properties that allow its parent containers to control it, and it has to expose events to notify its parents of some event occurring. Parent controls can also expose similar events and properties, but this adds a dependency on the parent control in the user control which may complicate re-use of the control in other containers.</p> <p>If you can break down many parts of your page into logical components that have clearly defined separation of responsibility, then they are ideal candidates for user controls. Its just like when you are defining classes, and yat some point a class may become too complex and you decide to partition it into several smaller classes, only here there is a higher cost for each new class you define.</p> <p>In my experience, user controls are great, just don't break down your controls to so many levels of depth to the point where you've created more complexity than the original bloated page. Try to find a happy medium where controls do just enough, not too much, and you don't have too many controls.</p> <p>Here are some tutorials on user control communication<br/> <a href="http://www.codeproject.com/KB/user-controls/Page_UserControl.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/user-controls/Page_UserControl.aspx</a><br/> <a href="http://aspalliance.com/1461_Page_and_User_Control_Communication" rel="nofollow noreferrer">http://aspalliance.com/1461_Page_and_User_Control_Communication</a></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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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